-
Notifications
You must be signed in to change notification settings - Fork 93
chore: Fix flaky FlagSynchronizerSpec polling tests #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kinyoklion
merged 20 commits into
v11
from
devin/1773943260-fix-flaky-flag-synchronizer-tests
Mar 23, 2026
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4863ff7
chore: Fix flaky FlagSynchronizerSpec polling tests
devin-ai-integration[bot] 2907884
chore: Address review feedback on polling test assertions
devin-ai-integration[bot] 5e84839
chore: trigger CI re-run (1 of 3)
devin-ai-integration[bot] 96376d6
chore: trigger CI re-run (2 of 3)
devin-ai-integration[bot] 0433d4e
chore: trigger CI re-run (3 of 3)
devin-ai-integration[bot] dbc5045
chore: Fix 'does not stop polling' test to detect restart regressions
devin-ai-integration[bot] 341b70d
chore: Add didSignal guard to remaining polling tests
devin-ai-integration[bot] cae3bd6
chore: Simplify polling test fixes — guard-only approach for starts/d…
devin-ai-integration[bot] cd3c610
chore: Fix flaky 'event reported while polling' test
devin-ai-integration[bot] 3684736
chore: trigger CI re-run (1 of 3)
devin-ai-integration[bot] 6ced240
chore: trigger CI re-run (2 of 3)
devin-ai-integration[bot] be6a5d2
chore: trigger CI re-run (3 of 3)
devin-ai-integration[bot] 8e87633
chore: trigger CI re-run (2 of 3)
devin-ai-integration[bot] c953ee8
chore: Add upper bounds check to 'stops polling' test
devin-ai-integration[bot] 2beb73e
chore: trigger CI stress test (1 of 3)
devin-ai-integration[bot] 3a938ce
chore: trigger CI stress test (2 of 3)
devin-ai-integration[bot] 71176ca
chore: trigger CI stress test (3 of 3)
devin-ai-integration[bot] 630525f
chore: trigger CI stress test round 2 (1 of 3)
devin-ai-integration[bot] 1e1a793
chore: trigger CI stress test round 2 (2 of 3)
devin-ai-integration[bot] 5d47632
chore: trigger CI stress test round 2 (3 of 3)
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there is still a race condition here. Similar to other cases we don't know that we will not get one more request to getFeatureFlags. Is there any way to know that the polling has finished stopping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Yes, there is a window where one more
getFeatureFlagscall could sneak through — betweenisOnline = falsein the callback and thecountAfterStopread. That's whycountAfterStopuses>= 2instead of== 2: it tolerates in-flight calls.The key assertion is the second one: after the 1.5-second sleep,
getFeatureFlagsCallCount == countAfterStop. Whatever the count was right after stopping (2, 3, etc.), it shouldn't change during the sleep. If it does, polling didn't actually stop.So the test doesn't claim to know the exact count at stop time — it just verifies the count stabilizes, which proves polling stopped.
Also: the CI failure on this push was a different flaky test (
event_reported_while_polling) with the same root cause —waitUntilcallback called multiple times by polling timer ticks. I've fixed that one too (same semaphore +didSignalguard pattern) in the latest push.