Skip to content

Commit

Permalink
Fix the metric race condition in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Jan 21, 2025
1 parent bcac22b commit 220d1d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ type fakeUDPAssociationMetrics struct {
var _ service.UDPAssociationMetrics = (*fakeUDPAssociationMetrics)(nil)

func (m *fakeUDPAssociationMetrics) AddAuthentication(key string) {
m.mu.Lock()
defer m.mu.Unlock()
m.accessKey = key
}

Expand Down
2 changes: 2 additions & 0 deletions service/udp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ type fakeUDPAssociationMetrics struct {
var _ UDPAssociationMetrics = (*fakeUDPAssociationMetrics)(nil)

func (m *fakeUDPAssociationMetrics) AddAuthentication(key string) {
m.mu.Lock()
defer m.mu.Unlock()
m.accessKey = key
}

Expand Down

0 comments on commit 220d1d7

Please sign in to comment.