Repository navigation
Open
Labels
Milestone
Description
Lines 185 to 187 in 979c724
| it('the favicon changes', async () => { | |
| await testFileModification(path.join(dataPath, 'favicon.ico'), 'html_other.h'); | |
| }); |
Lines 129 to 131 in 979c724
| // modify file | |
| fs.appendFileSync(sourceFilePath, ' '); | |
| // delay for 1 second to ensure the modified time is different |
Its not clear to me if there is really a problem - like npm run build not detecting a change in wled00/data/favicon.ico - or adding ascii junk to a binary file is not enough anymore to count as a "file change".
# Subtest: the favicon changes
not ok 8 - the favicon changes
---
duration_ms: 4542.527046
location: '/home/runner/work/WLED/WLED/tools/cdata-test.js:185:5'
failureType: 'testCodeFailure'
error: 'wled00/html_other.h was not modified'
code: 'ERR_ASSERTION'
name: 'AssertionError'
expected: true
actual: false
operator: '=='
stack: |-
checkIfFileWasNewlyCreated (/home/runner/work/WLED/WLED/tools/cdata-test.js:122:5)
testFileModification (/home/runner/work/WLED/WLED/tools/cdata-test.js:137:11)
process.processTicksAndRejections (node:internal/process/task_queues:95:5)
async TestContext.<anonymous> (/home/runner/work/WLED/WLED/tools/cdata-test.js:186:7)
async Test.run (node:internal/test_runner/test:797:9)
async Suite.processPendingSubtests (node:internal/test_runner/test:526:7)
...
Activity
softhack007 commentedon May 8, 2026
I'll disable the broken CI testcase until we have a solution.
DedeHai commentedon Dec 2, 2026
my AI just mentioned this. I do not know if it is right but it might be. This is what it sais:
"In cdata-test.js, testFileModification() previously checked whether the output header was rebuilt by asserting Date.now() - modifiedTime < 850 after the entire node tools/cdata.js command finished.
Because cdata.js writes small files like wled00/json_ledtypes.h (and html_other.h) early in the build, and then spends ~5 seconds minifying html_ui.h and html_settings.h, json_ledtypes.h is already ~5 seconds old by the time cdata.js exits — causing Date.now() - modifiedTime < 850 to fail even though the file was rebuilt. (This is also why the commented-out favicon.ico → html_other.h test in #5581 was failing.)
Comparing mtimeMs before vs. after the second cdata.js run (fs.statSync(targetPath).mtimeMs > beforeMtime) directly checks whether the file was actually rewritten, without depending on build order or CPU speed."
and this is what the suggested fix ought to be: