system::tracer_reload fails on main in its Log tracer path-change part. Found while testing #456 (PR #462), which ran the same test on main to compare.
What happens.tests/src/system/tracer_reload.rs starts a stream of 2000 events, sleeps 5 ms, then moves the tracer to a new path. The stream only yields for 1 ms every 50 events, so it finishes in a few tens of ms, and here all 2000 events reached the old file before the reload ran. Then wait_for(&new_file, "seq-01999-end") never sees the last event in the new file, and no event of the stream reached the new file can't hold.
So the test depends on the stream still running when the reload lands, and nothing makes sure of that. A fast machine (or a slow reload) breaks it. CI only compiles tests (--no-run), so CI doesn't catch it.
Fix. Keep emitting until the reload is seen, not for a fixed count: run the stream until a stop flag is set, set it once a marker emitted after assert_applied shows up in the new file, then check that each sequence number is in exactly one file and that both files got some. Keep the other parts (JSON format switch, tracer removal) as they are.
Done when
tracer_reload_tests passes on main, run several times in a row
The path-change part still proves no event is lost or written twice across the switch
`system::tracer_reload` fails on main in its Log tracer path-change part. Found while testing #456 (PR #462), which ran the same test on main to compare.
**What happens.** `tests/src/system/tracer_reload.rs` starts a stream of 2000 events, sleeps 5 ms, then moves the tracer to a new path. The stream only yields for 1 ms every 50 events, so it finishes in a few tens of ms, and here all 2000 events reached the old file before the reload ran. Then `wait_for(&new_file, "seq-01999-end")` never sees the last event in the new file, and `no event of the stream reached the new file` can't hold.
So the test depends on the stream still running when the reload lands, and nothing makes sure of that. A fast machine (or a slow reload) breaks it. CI only compiles tests (`--no-run`), so CI doesn't catch it.
**Fix.** Keep emitting until the reload is seen, not for a fixed count: run the stream until a stop flag is set, set it once a marker emitted after `assert_applied` shows up in the new file, then check that each sequence number is in exactly one file and that both files got some. Keep the other parts (JSON format switch, tracer removal) as they are.
**Done when**
- `tracer_reload_tests` passes on main, run several times in a row
- The path-change part still proves no event is lost or written twice across the switch
Fixed in #465. The path-change stream now runs until the new file has some of it, rather than for a fixed 2000 events, and the move starts only once the old file has some. The test still checks every event lands in exactly one file and both files get part of the stream. 6 of 6 local runs in a row passed (about 3,800 events each). Test-only, so nothing ships.
Fixed in #465. The path-change stream now runs until the new file has some of it, rather than for a fixed 2000 events, and the move starts only once the old file has some. The test still checks every event lands in exactly one file and both files get part of the stream. 6 of 6 local runs in a row passed (about 3,800 events each). Test-only, so nothing ships.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
system::tracer_reloadfails on main in its Log tracer path-change part. Found while testing #456 (PR #462), which ran the same test on main to compare.What happens.
tests/src/system/tracer_reload.rsstarts a stream of 2000 events, sleeps 5 ms, then moves the tracer to a new path. The stream only yields for 1 ms every 50 events, so it finishes in a few tens of ms, and here all 2000 events reached the old file before the reload ran. Thenwait_for(&new_file, "seq-01999-end")never sees the last event in the new file, andno event of the stream reached the new filecan't hold.So the test depends on the stream still running when the reload lands, and nothing makes sure of that. A fast machine (or a slow reload) breaks it. CI only compiles tests (
--no-run), so CI doesn't catch it.Fix. Keep emitting until the reload is seen, not for a fixed count: run the stream until a stop flag is set, set it once a marker emitted after
assert_appliedshows up in the new file, then check that each sequence number is in exactly one file and that both files got some. Keep the other parts (JSON format switch, tracer removal) as they are.Done when
tracer_reload_testspasses on main, run several times in a rowFixed in #465. The path-change stream now runs until the new file has some of it, rather than for a fixed 2000 events, and the move starts only once the old file has some. The test still checks every event lands in exactly one file and both files get part of the stream. 6 of 6 local runs in a row passed (about 3,800 events each). Test-only, so nothing ships.