Skip to content

Commit

Permalink
test: TestSingleLeader data race fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jul 4, 2024
1 parent 3c1f61b commit b8f0548
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/controller/leader/leader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,11 @@ func TestSingleLeader(t *testing.T) {
assert.NoError(t, err)

// replace original leading coordinator's advertising url to ensure the leader url changes
coordinators[leaderIdx].mutex.Lock()
coordinators[leaderIdx].advertise, err = url.Parse("http://localhost:9999")
assert.NoError(t, err)
coordinators[leaderIdx].mutex.Unlock()

time.Sleep(leaseTTL + time.Millisecond*500)

leaderIdx, finalLeaderStr := leaderFromCoordinators(t, coordinators)
Expand Down

0 comments on commit b8f0548

Please sign in to comment.