From c211e8f5df890372b2732b6f92f52d9dd5f85382 Mon Sep 17 00:00:00 2001 From: Ricky Stewart Date: Mon, 5 Feb 2024 15:16:59 -0600 Subject: [PATCH] jobs,application_api: replace calls to `skip.Stress` with `skip.Duress` `skip.Duress()` seems like it should have been used in this case as it gives more time under both `race` and `deadlock`. This will give these tests some extra time if they run in a heavyweight configuration but not "under stress". Epic: CRDB-8308 Release note: None --- pkg/jobs/registry_external_test.go | 2 +- pkg/server/application_api/sql_stats_test.go | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/jobs/registry_external_test.go b/pkg/jobs/registry_external_test.go index f7c69622950e..726949fa5d99 100644 --- a/pkg/jobs/registry_external_test.go +++ b/pkg/jobs/registry_external_test.go @@ -797,7 +797,7 @@ func TestWaitWithRetryableError(t *testing.T) { registry.WaitForJobs( ctx, []jobspb.JobID{id}, )) - if !skip.Stress() { + if !skip.Duress() { require.Equalf(t, int64(targetNumberOfRetries), numberOfTimesDetected.Load(), "jobs query did not retry") } else { // For stress be lenient since we are relying on timing for leasing diff --git a/pkg/server/application_api/sql_stats_test.go b/pkg/server/application_api/sql_stats_test.go index 83c53e6e5bf2..18294b71dc64 100644 --- a/pkg/server/application_api/sql_stats_test.go +++ b/pkg/server/application_api/sql_stats_test.go @@ -47,9 +47,9 @@ import ( "github.com/stretchr/testify/require" ) -// additionalTimeoutUnderStress is the additional timeout to use for the http +// additionalTimeoutUnderDuress is the additional timeout to use for the http // client if under stress. -const additionalTimeoutUnderStress = 30 * time.Second +const additionalTimeoutUnderDuress = 30 * time.Second func TestStatusAPICombinedTransactions(t *testing.T) { defer leaktest.AfterTest(t)() @@ -57,8 +57,8 @@ func TestStatusAPICombinedTransactions(t *testing.T) { // Increase the timeout for the http client if under stress. additionalTimeout := 0 * time.Second - if skip.Stress() { - additionalTimeout = additionalTimeoutUnderStress + if skip.Duress() { + additionalTimeout = additionalTimeoutUnderDuress } var params base.TestServerArgs @@ -393,8 +393,8 @@ func TestStatusAPIStatements(t *testing.T) { // Increase the timeout for the http client if under stress. additionalTimeout := 0 * time.Second - if skip.Stress() { - additionalTimeout = additionalTimeoutUnderStress + if skip.Duress() { + additionalTimeout = additionalTimeoutUnderDuress } // Aug 30 2021 19:50:00 GMT+0000 @@ -520,8 +520,8 @@ func TestStatusAPICombinedStatementsTotalLatency(t *testing.T) { skip.UnderRace(t, "test is too slow to run under race") // Increase the timeout for the http client if under stress. additionalTimeout := 0 * time.Second - if skip.Stress() { - additionalTimeout = additionalTimeoutUnderStress + if skip.Duress() { + additionalTimeout = additionalTimeoutUnderDuress } sqlStatsKnobs := sqlstats.CreateTestingKnobs() @@ -676,8 +676,8 @@ func TestStatusAPICombinedStatementsWithFullScans(t *testing.T) { // Increase the timeout for the http client if under stress. additionalTimeout := 0 * time.Second - if skip.Stress() { - additionalTimeout = additionalTimeoutUnderStress + if skip.Duress() { + additionalTimeout = additionalTimeoutUnderDuress } skip.UnderStressRace(t, "test is too slow to run under stressrace")