diff --git a/pkg/ccl/sqlproxyccl/proxy_handler_test.go b/pkg/ccl/sqlproxyccl/proxy_handler_test.go index de2ba44efb51..f94c51bb49cc 100644 --- a/pkg/ccl/sqlproxyccl/proxy_handler_test.go +++ b/pkg/ccl/sqlproxyccl/proxy_handler_test.go @@ -414,6 +414,7 @@ func TestPrivateEndpointsACL(t *testing.T) { time.Second, 5*time.Millisecond, "Expected the connection to eventually fail", ) + require.Error(t, err) require.Regexp(t, "connection reset by peer|unexpected EOF", err.Error()) require.Equal(t, int64(1), s.metrics.ExpiredClientConnCount.Count()) }, @@ -1203,6 +1204,7 @@ func TestDenylistUpdate(t *testing.T) { time.Second, 5*time.Millisecond, "Expected the connection to eventually fail", ) + require.Error(t, err) require.Regexp(t, "closed|bad connection", err.Error()) require.Equal(t, int64(1), s.metrics.ExpiredClientConnCount.Count()) } diff --git a/pkg/ccl/sqlproxyccl/tenant/directory_cache_test.go b/pkg/ccl/sqlproxyccl/tenant/directory_cache_test.go index 5875bc36e236..e89ed471bb97 100644 --- a/pkg/ccl/sqlproxyccl/tenant/directory_cache_test.go +++ b/pkg/ccl/sqlproxyccl/tenant/directory_cache_test.go @@ -204,13 +204,14 @@ func TestWatchTenants(t *testing.T) { if tds.WatchTenantsListenersCount() != 0 { return errors.New("watchers have not been removed yet") } + + // Make sure watcher has attempted to restart, and invalidates entries. + if _, err := dir.LookupTenant(ctx, tenant10); err == nil { + return errors.New("entries have not been invalidated") + } return nil }) - // Entry was invalidated. - _, err = dir.LookupTenant(ctx, tenant10) - require.Regexp(t, "directory server has not been started", err.Error()) - // Trigger events, which will be missed by the tenant watcher. tds.DeleteTenant(tenant10) tenant20Data.Version = "002"