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

Commitcac6d4c

Browse files
authored
feat: add --max-failures to coder exp scaletest create-workspaces (#21315)
Adds `--max-failures` flag to `coder exp scaletest create-workspaces` so that we can tolerate a few failures without failing the command.When running our scale test infra, we create Kubernetes Jobs to create the initial cluster workspaces, then we have load-generation jobs that depend on them. At high scale, it's kind of expected that some of the requests will fail: even with 99.9% success, you still expect one failure per 1000. It's useful to be able to carry on with the scale test anyway and proceed to traffic generation.
1 parentb187d33 commitcac6d4c

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

‎cli/exp_scaletest.go‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -640,9 +640,10 @@ func (r *RootCmd) scaletestCleanup() *serpent.Command {
640640

641641
func (r*RootCmd)scaletestCreateWorkspaces()*serpent.Command {
642642
var (
643-
countint64
644-
retryint64
645-
templatestring
643+
countint64
644+
retryint64
645+
maxFailuresint64
646+
templatestring
646647

647648
noCleanupbool
648649
// TODO: implement this flag
@@ -847,8 +848,8 @@ func (r *RootCmd) scaletestCreateWorkspaces() *serpent.Command {
847848
returnxerrors.Errorf("cleanup tests: %w",err)
848849
}
849850

850-
ifres.TotalFail>0 {
851-
returnxerrors.New("load test failed,see above for more details")
851+
ifres.TotalFail>int(maxFailures) {
852+
returnxerrors.Errorf("load test failed,%d runs failed (max allowed: %d)",res.TotalFail,maxFailures)
852853
}
853854

854855
returnnil
@@ -963,6 +964,13 @@ func (r *RootCmd) scaletestCreateWorkspaces() *serpent.Command {
963964
Description:"Use the user logged in on the host machine, instead of creating users.",
964965
Value:serpent.BoolOf(&useHostUser),
965966
},
967+
{
968+
Flag:"max-failures",
969+
Env:"CODER_SCALETEST_MAX_FAILURES",
970+
Default:"0",
971+
Description:"Maximum number of runs that are allowed to fail before the entire test is considered failed. 0 means any failure will cause the test to fail.",
972+
Value:serpent.Int64Of(&maxFailures),
973+
},
966974
}
967975

968976
cmd.Options=append(cmd.Options,parameterFlags.cliParameters()...)

‎cli/exp_scaletest_test.go‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func TestScaleTestCreateWorkspaces(t *testing.T) {
5454
"--output","json:"+outputFile,
5555
"--parameter","foo=baz",
5656
"--rich-parameter-file","/path/to/some/parameter/file.ext",
57+
"--max-failures","1",
5758
)
5859
clitest.SetupConfig(t,client,root)
5960
pty:=ptytest.New(t)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp