From 9fcf533245b5400da3e714b3023259f685aafe55 Mon Sep 17 00:00:00 2001 From: Brendan Dougherty Date: Thu, 29 Aug 2024 18:04:34 -0400 Subject: [PATCH] Fix assertion to allow negative connection delta. v18 appears to create a lot of connections eagerly. Signed-off-by: Brendan Dougherty --- go/test/endtoend/vtcombo/recreate/recreate_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/go/test/endtoend/vtcombo/recreate/recreate_test.go b/go/test/endtoend/vtcombo/recreate/recreate_test.go index 582fb9c3747..81453206ec9 100644 --- a/go/test/endtoend/vtcombo/recreate/recreate_test.go +++ b/go/test/endtoend/vtcombo/recreate/recreate_test.go @@ -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) {