You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky server tests: shared JVM plus global static injection make FileReceiverTest order/timing sensitive #414
The server test task runs all ~638 tests in a single JVM (no forkEvery/maxParallelForks in server/build.gradle), and FileReceiverTest.setUpBeforeClass() injects a mock ControllerFactory into global static state via Guice requestStaticInjection. That static state and the JVM are shared across every test class, so execution order and timing can change results.
FileReceiverTest.testPoll1 (an exact file-count assertion) failed once in CI on #405, passed on re-run, and does not reproduce locally on macOS or on a native-Linux Docker run of the same commit. So it's a non-deterministic flake surfaced by ordering/timing, not a product bug.
Directions, by appetite:
Set forkEvery on the server test task so one class's static state can't leak into another (costs some wall-time).
Or reset the global ControllerFactory in an @AfterClass and stop using requestStaticInjection for shared state.
Or make the assertion order-independent (filter the fixture dir to the expected files instead of asserting an exact count).
Context: found while diagnosing a CI failure on #405.
I think I tracked this one down in #467 (same flake, this time on testPoll2). It turns out the cause isn't shared static state or test order: receiver.start() schedules a real background poll every 5 s, which occasionally sneaks an extra batch in mid-test. So forkEvery wouldn't help here, but a one-line change in createReceiver() should. Details and repro are in #467 (comment) 🙂
Activity
e210 commentedon Oct 4, 2026
I think I tracked this one down in #467 (same flake, this time on
testPoll2). It turns out the cause isn't shared static state or test order:receiver.start()schedules a real background poll every 5 s, which occasionally sneaks an extra batch in mid-test. SoforkEverywouldn't help here, but a one-line change increateReceiver()should. Details and repro are in #467 (comment) 🙂