From 08959eb367824c04f9627209bc95392147f9ab32 Mon Sep 17 00:00:00 2001 From: Austen McClernon Date: Thu, 19 Oct 2023 23:30:01 +0000 Subject: [PATCH] streamingccl: reduce scan interval for testing Reduce the replica scanner min interval from 1s, to 10ms for test clusters. This speeds up tests which rely on replica changes either on the source, or host cluster. ``` dev test pkg/ccl/streamingccl/streamingest \ -f TestStreamingRegionalConstraint -v --stress ... Stats over 1000 runs: max = 51.9s, min = 21.6s, avg = 38.3s, dev = 4.6s ``` Resolves: #112541 Release note: None --- pkg/ccl/streamingccl/replicationtestutils/testutils.go | 1 + .../streamingccl/streamingest/replication_stream_e2e_test.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/ccl/streamingccl/replicationtestutils/testutils.go b/pkg/ccl/streamingccl/replicationtestutils/testutils.go index 304310270259..f86326137e0d 100644 --- a/pkg/ccl/streamingccl/replicationtestutils/testutils.go +++ b/pkg/ccl/streamingccl/replicationtestutils/testutils.go @@ -357,6 +357,7 @@ func startC2CTestCluster( for i, locality := range regions { param := serverArgs param.Locality = makeLocality(locality) + param.ScanMaxIdleTime = 10 * time.Millisecond serverArgsPerNode[i] = param } params.ServerArgsPerNode = serverArgsPerNode diff --git a/pkg/ccl/streamingccl/streamingest/replication_stream_e2e_test.go b/pkg/ccl/streamingccl/streamingest/replication_stream_e2e_test.go index 30d74eee3904..e0593d333812 100644 --- a/pkg/ccl/streamingccl/streamingest/replication_stream_e2e_test.go +++ b/pkg/ccl/streamingccl/streamingest/replication_stream_e2e_test.go @@ -1170,7 +1170,6 @@ func TestStreamingRegionalConstraint(t *testing.T) { defer leaktest.AfterTest(t)() defer log.Scope(t).Close(t) skip.UnderStressRace(t, "takes too long under stress race") - skip.UnderStress(t, "the allocator machinery stuggles with cpu contention, which can cause the test to timeout") ctx := context.Background() regions := []string{"mars", "venus", "mercury"} @@ -1204,7 +1203,8 @@ func TestStreamingRegionalConstraint(t *testing.T) { for _, desc := range descriptors { for _, replica := range desc.InternalReplicas { if replica.NodeID != marsNodeID { - return errors.Newf("found table data located on another node %d", replica.NodeID) + return errors.Newf("found table data located on another node %d, desc %v", + replica.NodeID, desc) } } }