Skip to content

Fix flaky testBypassSignalDependenciesWithBlocking by waiting for async notify - #227

Open
nikhiln64 wants to merge 1 commit into
Netflix:mainfrom
nikhiln64:fix/flaky-bypass-dependencies-test
Open

Fix flaky testBypassSignalDependenciesWithBlocking by waiting for async notify#227
nikhiln64 wants to merge 1 commit into
Netflix:mainfrom
nikhiln64:fix/flaky-bypass-dependencies-test

Conversation

@nikhiln64

Copy link
Copy Markdown

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes (Please run ./gradlew build --write-locks to refresh dependencies)
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

Fixes an intermittent failure in MaestroStepInstanceActionDaoTest.testBypassSignalDependenciesWithBlocking.

The bypass action runs on a virtual thread. The enqueue verification waits with timeout(30000), but the notify verification immediately after it had no timeout, so it raced the third notify call from the async thread and intermittently failed with TooFewActualInvocations (wanted 3, got 2) - typically under load during a full ./gradlew build, while passing in isolation.

The fix uses the same timeout-based verification as the surrounding assertions in this test, so the intent is unchanged and the assertion simply waits for the async work instead of racing it.

Verified: ./gradlew :maestro-engine:test --tests MaestroStepInstanceActionDaoTest green on 3 consecutive reruns; spotlessApply run as per the template.

@nikhiln64
nikhiln64 force-pushed the fix/flaky-bypass-dependencies-test branch from bf6a36c to 128e68b Compare July 14, 2026 14:01
@nikhiln64
nikhiln64 force-pushed the fix/flaky-bypass-dependencies-test branch from 128e68b to dd37238 Compare July 21, 2026 19:33
…nc notify

The bypass action runs on a virtual thread. The enqueue verification
waits with timeout(30000), but the following notify verification had no
timeout, so it raced the third notify call and intermittently failed
with TooFewActualInvocations (wanted 3, got 2). Use the same
timeout-based verification as the surrounding assertions.
@nikhiln64
nikhiln64 force-pushed the fix/flaky-bypass-dependencies-test branch from dd37238 to 70720fe Compare July 21, 2026 20:25
@nikhiln64

Copy link
Copy Markdown
Author

@jun-he when you get a moment, the CI run for this one is waiting for maintainer approval to start. It is a small deterministic fix for a flaky test race and the branch is current with main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant