From 743fe5b91b2e195fc05c90eb47eca90f30d623c5 Mon Sep 17 00:00:00 2001 From: flaky-claw Date: Thu, 16 Apr 2026 12:19:08 +0000 Subject: [PATCH 1/2] fix: stabilize flaky issue #67699 --- .../checkpoint/randomized_integration_test.go | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go b/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go index 8a2a2b8c7e813..6052ebd77beeb 100644 --- a/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go +++ b/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go @@ -19,6 +19,7 @@ import ( "fmt" "math" "math/rand" + "os" "sync" "testing" "time" @@ -268,22 +269,24 @@ func (s *randomizedCRRSimulation) runRound( s.rememberSyncedTS() - s.log( - "randomized crr round", - zap.Int("round", round), - zap.Uint64s("flushed-stores", roundLog.flushedStores), - zap.Int("replicated-files", roundLog.replicatedFiles), - zap.Bool("restarted-calculator", roundLog.restartedCalculator), - zap.Uint64s("added-stores", roundLog.addedStores), - zap.Uint64s("removed-stores", roundLog.removedStores), - zap.Uint64s("scattered-regions", roundLog.scatteredRegions), - zap.Strings("action-order", roundLog.actionOrder), - zap.Bool("advanced", roundLog.advanced), - zap.Uint64("checkpoint", roundLog.checkpoint), - zap.Uint64("safe-checkpoint", *lastSafeCheckpoint), - zap.Uint64("validated-checkpoint", *lastValidatedCheckpoint), - zap.String("state", s.describeState()), - ) + if os.Getenv("TIDB_RANDOMIZED_CRR_SIM_ROUND_LOG") != "" { + s.log( + "randomized crr round", + zap.Int("round", round), + zap.Uint64s("flushed-stores", roundLog.flushedStores), + zap.Int("replicated-files", roundLog.replicatedFiles), + zap.Bool("restarted-calculator", roundLog.restartedCalculator), + zap.Uint64s("added-stores", roundLog.addedStores), + zap.Uint64s("removed-stores", roundLog.removedStores), + zap.Uint64s("scattered-regions", roundLog.scatteredRegions), + zap.Strings("action-order", roundLog.actionOrder), + zap.Bool("advanced", roundLog.advanced), + zap.Uint64("checkpoint", roundLog.checkpoint), + zap.Uint64("safe-checkpoint", *lastSafeCheckpoint), + zap.Uint64("validated-checkpoint", *lastValidatedCheckpoint), + zap.String("state", s.describeState()), + ) + } if roundLog.advanced { require.GreaterOrEqualf( From 7b2c60068b987ea9fca139fa1e944af65cfd81eb Mon Sep 17 00:00:00 2001 From: yinsustart Date: Wed, 22 Apr 2026 18:52:50 +0800 Subject: [PATCH 2/2] br/pkg/stream/crr/internal/checkpoint: reduce randomized test rounds --- .../crr/internal/checkpoint/randomized_integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go b/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go index 6052ebd77beeb..0982d7fdac180 100644 --- a/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go +++ b/br/pkg/stream/crr/internal/checkpoint/randomized_integration_test.go @@ -35,7 +35,7 @@ func TestCheckpointCalculatorRandomizedCRRSimulation(t *testing.T) { ctx := context.Background() tc := testutil.NewTestContext(t) cfg := randomizedCRRSimulationConfig{ - Iterations: 1000, + Iterations: 300, InitialStores: 3, MaxStores: 12, RegionCount: 12,