Skip to content

Commit

Permalink
streamingccl: reduce scan interval for testing
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kvoli committed Oct 20, 2023
1 parent 48baa96 commit 08959eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/ccl/streamingccl/replicationtestutils/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 08959eb

Please sign in to comment.