From 77e8d2b8874c61751cbd983fb0544572b5c4a6c2 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Tue, 21 Oct 2025 08:58:04 +0400 Subject: [PATCH] feat: add configurable timeouts to exp scaletest dynamic-parameters (#20355) Adds timeout configuration to `exp scaletest dynamic-parameters` closes: https://github.com/coder/internal/issues/912 --- cli/exp_scaletest_dynamicparameters.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cli/exp_scaletest_dynamicparameters.go b/cli/exp_scaletest_dynamicparameters.go index 2998be2e3f..3c6922a8d4 100644 --- a/cli/exp_scaletest_dynamicparameters.go +++ b/cli/exp_scaletest_dynamicparameters.go @@ -30,6 +30,8 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command { numEvals int64 tracingFlags = &scaletestTracingFlags{} prometheusFlags = &scaletestPrometheusFlags{} + // This test requires unlimited concurrency + timeoutStrategy = &timeoutFlags{} ) orgContext := NewOrganizationContext() output := &scaletestOutputFlags{} @@ -102,7 +104,10 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command { return xerrors.Errorf("setup dynamic parameters partitions: %w", err) } - th := harness.NewTestHarness(harness.ConcurrentExecutionStrategy{}, harness.ConcurrentExecutionStrategy{}) + th := harness.NewTestHarness( + timeoutStrategy.wrapStrategy(harness.ConcurrentExecutionStrategy{}), + // there is no cleanup since it's just a connection that we sever. + nil) for i, part := range partitions { for j := range part.ConcurrentEvaluations { @@ -123,7 +128,9 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command { } } - err = th.Run(ctx) + testCtx, testCancel := timeoutStrategy.toContext(ctx) + defer testCancel() + err = th.Run(testCtx) if err != nil { return xerrors.Errorf("run test harness: %w", err) } @@ -158,5 +165,6 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command { output.attach(&cmd.Options) tracingFlags.attach(&cmd.Options) prometheusFlags.attach(&cmd.Options) + timeoutStrategy.attach(&cmd.Options) return cmd }