Commit 828abe1
authored
chore: fix unstable log on replay-logs-chronological-order snap-test (#347)
### TL;DR
Added a delay before the main process ends to ensure logs are properly flushed to stdout.
### What changed?
- Imported the `scheduler` from `node:timers/promises`
- Added a 100ms delay using `scheduler.wait(100)` before the main process ends
- Added a comment explaining that this delay ensures logs from echo.js are flushed to stdout before the main process terminates
### How to test?
Run the replay-logs-chronological-order snap test and verify that all logs from the child processes are properly captured in the output.
### Why make this change?
Without this delay, the main process might terminate before all child process logs are properly flushed to stdout, potentially causing logs to be missed or appear out of order in test results. This change ensures more reliable and consistent test output.1 parent e7285a8 commit 828abe1
1 file changed
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
0 commit comments