Skip to content

Commit

Permalink
Merge #105842
Browse files Browse the repository at this point in the history
105842: sqlproxyccl: deflake TestResume r=JeffSwenson a=JeffSwenson

TestResume contains a rare flake. Running under stress I was unable to reproduce it, but stress+deadlock produced the same symptoms every hundred attempts. It appears under load, starting a tenant will occasionally take more than 10 seconds. Looking at the tenant logs, most of the time was spent running upgrade migrations.

Fixes: #100682

Co-authored-by: Jeff <[email protected]>
  • Loading branch information
craig[bot] and jeffswenson committed Jun 29, 2023
2 parents da4a10b + 0de1c8a commit d0b9088
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/ccl/sqlproxyccl/tenant/directory_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ func TestCancelLookups(t *testing.T) {
func TestResume(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.ScopeWithoutShowLogs(t).Close(t)
skip.UnderDeadlockWithIssue(t, 71365)

tenantID := roachpb.MustMakeTenantID(40)
const lookupCount = 5
Expand All @@ -437,12 +436,15 @@ func TestResume(t *testing.T) {
}(i)
}

var processes map[net.Addr]*tenantdirsvr.Process
// Eventually the tenant process will be resumed.
require.Eventually(t, func() bool {
var processes map[net.Addr]*tenantdirsvr.Process
testutils.SucceedsSoon(t, func() error {
processes = tds.Get(tenantID)
return len(processes) == 1
}, 10*time.Second, 100*time.Millisecond)
if len(processes) != 1 {
return errors.Newf("expected 1 processes found %d", len(processes))
}
return nil
})

// Wait until background goroutines complete.
wait.Wait()
Expand Down

0 comments on commit d0b9088

Please sign in to comment.