Skip to content

Conversation

@eljpsm
Copy link
Contributor

@eljpsm eljpsm commented Nov 4, 2025

Pull Request

Description

Sharing one WaitGroup across parallel subtests caused races and flaky tests. Declare wg locally in each t.Run so each subtest has its own sync.WaitGroup.

  • Remove shared wg at top of TestMemoryCache_ConcurrentAccess
  • Add var wg sync.WaitGroup inside Concurrent writes, Concurrent reads and writes, and Concurrent deletes subtests

Sharing one WaitGroup across parallel subtests caused races and flaky tests. Declare wg locally in each t.Run so each subtest has its own sync.WaitGroup.

- Remove shared wg at top of TestMemoryCache_ConcurrentAccess
- Add var wg sync.WaitGroup inside Concurrent writes, Concurrent reads and writes, and Concurrent deletes subtests
@eljpsm eljpsm merged commit db3130d into main Nov 4, 2025
6 checks passed
@eljpsm eljpsm deleted the fix-tests branch November 4, 2025 05:35
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.

2 participants