Skip to content

Commit

Permalink
Merge #28131
Browse files Browse the repository at this point in the history
28131: security: fix rotation test flakiness. r=mberhault a=mberhault

Fixes #28125

Move the sql client test success condition into the "SucceedsSoon" loop,
this was failing occasionally on stress tests. We're relying on the go
sql package trying the connection again after a failure, it doesn't seem
to be as guaranteed as expected.

Release note: None

Co-authored-by: marc <[email protected]>
  • Loading branch information
craig[bot] and marc committed Aug 1, 2018
2 parents cbe3d10 + a5bb8d0 commit 492cbd3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/security/certs_rotation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,17 +228,15 @@ func TestRotateCerts(t *testing.T) {
t.Fatal(err)
}

// Wait until client3 succeeds.
// Wait until client3 succeeds (both http and sql).
testutils.SucceedsSoon(t,
func() error {
if err := clientTest(thirdClient); err != nil {
return errors.Errorf("third client failed: %v", err)
return errors.Errorf("third HTTP client failed: %v", err)
}
if _, err := thirdSQLClient.Exec("SELECT 1"); err != nil {
return errors.Errorf("third SQL client failed: %v", err)
}
return nil
})

// SQL client 3 should also succeed.
if _, err := thirdSQLClient.Exec("SELECT 1"); err != nil {
t.Fatal(err)
}
}

0 comments on commit 492cbd3

Please sign in to comment.