Commit e6c77c8
committed
test(sync): wait for watcher handlers to register in SIGHUP cache test
"reloads sync config when SIGHUP is received" flaked on the Node 22 CI
job with TypeError: handlers[0] is not a function, because the fixed-50
rounds of flushWatchSetup() occasionally return before chokidar's
dynamic-import + FS-sweep chain reaches watcher.on('change', ...).
Add a bounded wait-until-registered loop (max 10 extra flushes) and a
length assertion so the test either succeeds or fails loudly with a
clear diagnostic, instead of the misleading TypeError. The sibling
"three ticks" test at line 1027 already has an implicit barrier
(expect(handlers.length).toBeGreaterThan(0)) which is why it has not
flaked.1 parent 117d576 commit e6c77c8
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1076 | 1076 | | |
1077 | 1077 | | |
1078 | 1078 | | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
1079 | 1087 | | |
1080 | 1088 | | |
1081 | 1089 | | |
| |||
0 commit comments