fix: add mutex to mockLogger in errorbus tests to prevent race conditions
The mockLogger's errors slice was being accessed concurrently from multiple goroutines (the error bus consumer and the test goroutine), causing race conditions when running tests with the race detector. Added sync.Mutex to protect the errors slice and proper locking when accessing it in test assertions.
This commit is contained in:
@@ -150,8 +150,10 @@ When working on this project, follow this workflow:
|
||||
- Use descriptive branch names (e.g., `feature/epic1-http-server`, `bugfix/auth-token-expiry`, `enhancement/rate-limiting`)
|
||||
- Branch names should follow the pattern: `{type}/{epic}-{short-description}` or `{type}/{story-id}-{short-description}`
|
||||
- **ALWAYS create a commit** after successfully implementing a feature that:
|
||||
- ✅ Builds successfully (`go build` passes)
|
||||
- ✅ Tests pass (`go test` passes)
|
||||
- ✅ Builds successfully (`make build` passes)
|
||||
- ✅ Tests pass (`make test` passes)
|
||||
- ✅ Lint pass (`make lint` passes)
|
||||
- ✅ fmt-check pass (`make fmt-check` passes)
|
||||
- ✅ Meets all acceptance criteria from the story
|
||||
- Commit messages should be clear and descriptive, referencing the story/epic when applicable
|
||||
- Never commit directly to `main` branch
|
||||
|
||||
Reference in New Issue
Block a user