Skip to content

[PM-36578] test: Fix flaky test_passwordHistoryPublisher in GeneratorRepositoryTests#2615

Merged
KatherineInCode merged 2 commits into
mainfrom
pm-36578/flaky-generator-test
May 8, 2026
Merged

[PM-36578] test: Fix flaky test_passwordHistoryPublisher in GeneratorRepositoryTests#2615
KatherineInCode merged 2 commits into
mainfrom
pm-36578/flaky-generator-test

Conversation

@KatherineInCode
Copy link
Copy Markdown
Contributor

@KatherineInCode KatherineInCode commented May 5, 2026

🎟️ Tracking

PM-36578

📔 Objective

Fixes a flaky test_passwordHistoryPublisher test in GeneratorRepositoryTests. The old implementation used fire-and-forget Task { } blocks to call addPasswordHistory, then immediately polled with waitFor, creating a race condition in CI. Rewrote the test as async throws using an AsyncIterator, so each add operation is awaited directly before calling iterator.next() — fully sequential, no concurrent tasks, no race conditions. Follows the same pattern already used in GeneratorDataStoreTests.test_passwordHistoryPublisher().

@KatherineInCode KatherineInCode added the ai-review-vnext Request a Claude code review using the vNext workflow label May 5, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt labels May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed PR #2615 which refactors test_passwordHistoryPublisher in GeneratorRepositoryTests to eliminate a CI flake. The change replaces fire-and-forget Task { } blocks plus waitFor polling with sequential await on an AsyncIterator, removing the underlying race condition. The new pattern mirrors the established approach in GeneratorDataStoreTests.test_passwordHistoryPublisher(), the test-only scope is appropriate, and assertions retain equivalent coverage.

Code Review Details

No findings.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.23%. Comparing base (4047574) to head (eb306d6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2615   +/-   ##
=======================================
  Coverage   87.22%   87.23%           
=======================================
  Files        1899     1899           
  Lines      168083   168073   -10     
=======================================
- Hits       146612   146611    -1     
+ Misses      21471    21462    -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KatherineInCode KatherineInCode marked this pull request as ready for review May 6, 2026 15:20
@KatherineInCode KatherineInCode requested review from a team and matt-livefront as code owners May 6, 2026 15:20
@KatherineInCode KatherineInCode merged commit e795e9e into main May 8, 2026
25 of 28 checks passed
@KatherineInCode KatherineInCode deleted the pm-36578/flaky-generator-test branch May 8, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review-vnext Request a Claude code review using the vNext workflow app:password-manager Bitwarden Password Manager app context t:tech-debt Change Type - Tech debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants