Skip to content

Commit

Permalink
Fix assertion to allow negative connection delta. v18 appears to crea…
Browse files Browse the repository at this point in the history
…te a lot of connections eagerly.

Signed-off-by: Brendan Dougherty <[email protected]>
  • Loading branch information
brendar committed Aug 29, 2024
1 parent 75411b0 commit 9fcf533
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/test/endtoend/vtcombo/recreate/recreate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ func TestDropAndRecreateWithSameShards(t *testing.T) {
require.Nil(t, err)

// Assert that we're not leaking mysql connections, but allow for some wiggle room due to transient connections
assert.InDelta(t, mysqlConnCountBefore, mysqlConnCountAfter, 5,
"not within allowable delta: mysqlConnCountBefore=%d, mysqlConnCountAfter=%d", mysqlConnCountBefore, mysqlConnCountAfter)
delta := mysqlConnCountAfter - mysqlConnCountBefore
assert.LessOrEqual(t, delta, 5,
"mysqlConnCountBefore=%d, mysqlConnCountAfter=%d, delta=%d", mysqlConnCountBefore, mysqlConnCountAfter, delta)
}

func getMySQLConnectionCount(ctx context.Context, session *vtgateconn.VTGateSession) (int, error) {
Expand Down

0 comments on commit 9fcf533

Please sign in to comment.