Add a sleep to give the event system time to start (#24141)

This commit is contained in:
Violet Hynes
2023-11-15 10:33:27 -05:00
committed by GitHub
parent 15ee7dd6c8
commit 91ab8a5178

View File

@@ -424,6 +424,10 @@ func Test_StreamStaticSecretEvents_UpdatesCacheWithNewSecrets(t *testing.T) {
t.Fatal(err)
}
// Wait for the event stream to be fully up and running. Should be faster than this in reality, but
// we make it five seconds to protect against CI flakiness.
time.Sleep(5 * time.Second)
// Put a secret, which should trigger an event
_, err = client.KVv2("secret-v2").Put(context.Background(), "foo", secretData)
if err != nil {
@@ -434,7 +438,7 @@ func Test_StreamStaticSecretEvents_UpdatesCacheWithNewSecrets(t *testing.T) {
// than this, but we make it five seconds to protect against CI flakiness.
time.Sleep(5 * time.Second)
// Then, do a GET to see if the event got updated
// Then, do a GET to see if the index got updated by the event
newIndex, err := leaseCache.db.Get(cachememdb.IndexNameID, indexId)
if err != nil {
t.Fatal(err)