mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 20:36:26 +02:00
Use a 10s timeout instead of 3s to reduce test flakiness. The purpose of the timeout is to ensure that if something's broken the test doesn't run forever. However if things are slow, it could lead to the test failing. Also report on whether we got the lock so that if this fix doesn't solve the problem, we have more information to go on. (#11222)
This commit is contained in:
parent
65f1f2cccd
commit
1e27062732
@ -233,9 +233,8 @@ func TestMySQLHABackend_LockFailPanic(t *testing.T) {
|
||||
t.Fatalf("lock 2: %v", err)
|
||||
}
|
||||
|
||||
// Cancel attempt in 50 msec
|
||||
stopCh := make(chan struct{})
|
||||
time.AfterFunc(3*time.Second, func() {
|
||||
time.AfterFunc(10*time.Second, func() {
|
||||
close(stopCh)
|
||||
})
|
||||
|
||||
@ -256,14 +255,13 @@ func TestMySQLHABackend_LockFailPanic(t *testing.T) {
|
||||
// trigger the panic shown in https://github.com/hashicorp/vault/issues/8203
|
||||
cleanup()
|
||||
|
||||
// Cancel attempt in 50 msec
|
||||
stopCh2 := make(chan struct{})
|
||||
time.AfterFunc(3*time.Second, func() {
|
||||
time.AfterFunc(10*time.Second, func() {
|
||||
close(stopCh2)
|
||||
})
|
||||
leaderCh2, err = lock2.Lock(stopCh2)
|
||||
if err == nil {
|
||||
t.Fatalf("expected error, got none")
|
||||
t.Fatalf("expected error, got none, leaderCh2=%v", leaderCh2)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user