Skip to content

Commit 602595e

Browse files
committed
c2c: reduce TestStreamingAutoReplan runtime
In a suprising twist, cockroachdb#106853 deflaked this test, but also increased the runtime to 10 minutes. To understand why, consider that the default value of the stream_replication.replan_flow_frequency setting is 10 minutes, and if the user changes the cluster setting, the frequency will only take effect on the next replanning check. So, if a stream begins at t0, and the user changes the setting at t1, the replanning frequency will actually change 10 minutes after t0. In cockroachdb#105853 patch reduced stream_replication.replan_flow_frequency setting to 500 ms _after_ the stream began, which caused the next replanninng check to occur a full 10 minutes after the stream started! This patch changes this cluster setting _before_ the stream begins, reducing the runtime of this test to a speedy 10 seconds. Epic: none Release note: none
1 parent 8d2d2bf commit 602595e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/ccl/streamingccl/streamingest/replication_stream_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ func TestStreamingAutoReplan(t *testing.T) {
729729
defer cleanup()
730730
// Don't allow for replanning until the new nodes and scattered table have been created.
731731
serverutils.SetClusterSetting(t, c.DestCluster, "stream_replication.replan_flow_threshold", 0)
732+
serverutils.SetClusterSetting(t, c.DestCluster, "stream_replication.replan_flow_frequency", time.Millisecond*500)
732733

733734
// Begin the job on a single source node.
734735
producerJobID, ingestionJobID := c.StartStreamReplication(ctx)
@@ -746,7 +747,6 @@ func TestStreamingAutoReplan(t *testing.T) {
746747

747748
// Configure the ingestion job to replan eagerly.
748749
serverutils.SetClusterSetting(t, c.DestCluster, "stream_replication.replan_flow_threshold", 0.1)
749-
serverutils.SetClusterSetting(t, c.DestCluster, "stream_replication.replan_flow_frequency", time.Millisecond*500)
750750

751751
// The ingestion job should eventually retry because it detects new nodes to add to the plan.
752752
require.Error(t, <-retryErrorChan, sql.ErrPlanChanged)

0 commit comments

Comments
 (0)