Skip to content

Conversation

@casibbald
Copy link
Collaborator

  • Added mutex synchronization and buffered channels to fix race conditions
  • Added WaitGroup to ensure goroutine completion in concurrent test

Closes

What changed?

Why was this change made?

How was this change implemented?

How did you validate the change?

Release notes

Documentation Changes

@casibbald casibbald requested a review from Copilot October 27, 2025 07:28
@casibbald casibbald changed the title Fix: Address synchronization and buffered channels fix: Address synchronization and buffered channels Oct 27, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses race conditions in concurrent test code by adding proper synchronization mechanisms. The changes focus on fixing test reliability issues that could occur when multiple goroutines access shared resources simultaneously.

  • Added mutex synchronization to prevent concurrent resource updates in simulateReconcile
  • Converted unbuffered channel to buffered and improved goroutine cleanup patterns
  • Added WaitGroup to ensure proper goroutine completion in concurrent test scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
core/server/sync_test.go Added mutex parameter to simulateReconcile calls and converted to buffered channel with improved error handling pattern
core/clustersmngr/factory_caches_test.go Wrapped concurrent goroutines with WaitGroup to ensure completion before assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@casibbald casibbald changed the title fix: Address synchronization and buffered channels refactor: Address synchronization and buffered channels Oct 27, 2025
@casibbald casibbald requested a review from erikgb October 27, 2025 07:50
@casibbald
Copy link
Collaborator Author

@erikgb Moved it here, it might have been a red herring. lets keep this PR open and monitor other builds

@casibbald casibbald force-pushed the fix/address-race-conditions branch from a145dd8 to c05eb0e Compare October 27, 2025 08:14
@casibbald casibbald marked this pull request as draft October 27, 2025 08:27
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