mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-18 22:59:57 +00:00
fix test
This commit is contained in:
@@ -1319,12 +1319,14 @@ func TestPolicyAccountPeersUpdate(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Updating disabled policy with destination and source groups containing peers should not update account's peers
|
// Updating disabled policy with destination and source groups containing peers should still update account's peers
|
||||||
// or send peer update
|
// because affected peer resolution does not filter by policy enabled state
|
||||||
t.Run("updating disabled policy with source and destination groups with peers", func(t *testing.T) {
|
t.Run("updating disabled policy with source and destination groups with peers", func(t *testing.T) {
|
||||||
|
drainPeerUpdates(updMsg)
|
||||||
|
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
peerShouldNotReceiveUpdate(t, updMsg)
|
peerShouldReceiveUpdate(t, updMsg)
|
||||||
close(done)
|
close(done)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -1335,8 +1337,8 @@ func TestPolicyAccountPeersUpdate(t *testing.T) {
|
|||||||
|
|
||||||
select {
|
select {
|
||||||
case <-done:
|
case <-done:
|
||||||
case <-time.After(time.Second):
|
case <-time.After(peerUpdateTimeout):
|
||||||
t.Error("timeout waiting for peerShouldNotReceiveUpdate")
|
t.Error("timeout waiting for peerShouldReceiveUpdate")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user