Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit77e8d2b

Browse files
authored
feat: add configurable timeouts to exp scaletest dynamic-parameters (#20355)
Adds timeout configuration to `exp scaletest dynamic-parameters`closes:coder/internal#912
1 parentccf0b34 commit77e8d2b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎cli/exp_scaletest_dynamicparameters.go‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command {
3030
numEvalsint64
3131
tracingFlags=&scaletestTracingFlags{}
3232
prometheusFlags=&scaletestPrometheusFlags{}
33+
// This test requires unlimited concurrency
34+
timeoutStrategy=&timeoutFlags{}
3335
)
3436
orgContext:=NewOrganizationContext()
3537
output:=&scaletestOutputFlags{}
@@ -102,7 +104,10 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command {
102104
returnxerrors.Errorf("setup dynamic parameters partitions: %w",err)
103105
}
104106

105-
th:=harness.NewTestHarness(harness.ConcurrentExecutionStrategy{}, harness.ConcurrentExecutionStrategy{})
107+
th:=harness.NewTestHarness(
108+
timeoutStrategy.wrapStrategy(harness.ConcurrentExecutionStrategy{}),
109+
// there is no cleanup since it's just a connection that we sever.
110+
nil)
106111

107112
fori,part:=rangepartitions {
108113
forj:=rangepart.ConcurrentEvaluations {
@@ -123,7 +128,9 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command {
123128
}
124129
}
125130

126-
err=th.Run(ctx)
131+
testCtx,testCancel:=timeoutStrategy.toContext(ctx)
132+
defertestCancel()
133+
err=th.Run(testCtx)
127134
iferr!=nil {
128135
returnxerrors.Errorf("run test harness: %w",err)
129136
}
@@ -158,5 +165,6 @@ func (r *RootCmd) scaletestDynamicParameters() *serpent.Command {
158165
output.attach(&cmd.Options)
159166
tracingFlags.attach(&cmd.Options)
160167
prometheusFlags.attach(&cmd.Options)
168+
timeoutStrategy.attach(&cmd.Options)
161169
returncmd
162170
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp