mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 02:45:42 +03:00
deploymentwatcher: fix test data race.
This commit is contained in:
@@ -614,8 +614,17 @@ func TestWatcher_AutoPromoteDeployment(t *testing.T) {
|
||||
|
||||
// Start the deployment
|
||||
w.SetEnabled(true, m.state)
|
||||
testutil.WaitForResult(func() (bool, error) { return 1 == len(w.watchers), nil },
|
||||
func(err error) { require.Equal(t, 1, len(w.watchers), "Should have 1 deployment") })
|
||||
testutil.WaitForResult(func() (bool, error) {
|
||||
w.l.RLock()
|
||||
defer w.l.RUnlock()
|
||||
return 1 == len(w.watchers), nil
|
||||
},
|
||||
func(err error) {
|
||||
w.l.RLock()
|
||||
defer w.l.RUnlock()
|
||||
require.Equal(t, 1, len(w.watchers), "Should have 1 deployment")
|
||||
},
|
||||
)
|
||||
|
||||
// Mark the canaries healthy
|
||||
req := &structs.DeploymentAllocHealthRequest{
|
||||
|
||||
Reference in New Issue
Block a user