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

Commita71e5cc

Browse files
test: add increasing integer to GetRandomNameHyphenated (#19481)
Fixes flakes like the following:```workspaces_test.go:4938: Error Trace:/home/runner/work/coder/coder/coderd/coderdtest/coderdtest.go:1279/home/runner/work/coder/coder/coderd/workspaces_test.go:4938/home/runner/work/coder/coder/coderd/workspaces_test.go:5044Error: Received unexpected error:POSThttp://127.0.0.1:42597/api/v2/users/me/workspaces: unexpected status code 409: Workspace "romantic-mcclintock" already exists.name: This value is already in use and should be unique.Test: TestWorkspaceCreateWithImplicitPreset/SinglePresetWithParameters```https://github.com/coder/coder/actions/runs/17142665868/job/48633017007?pr=19464 Which are caused by insufficient randomness when creating multipleworkspaces with random names. Two words is not enough to avoid flakes.We have a `testutil.GetRandomName` function that appends a monotonicallyincreasing integer, but this alternative function that uses hyphensdoesn't add that integer. This PR fixes that by just`testutil.GetRandomName`
1 parent9a872f9 commita71e5cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎testutil/names.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func GetRandomName(t testing.TB) string {
3030
// an underscore.
3131
funcGetRandomNameHyphenated(t testing.TB)string {
3232
t.Helper()
33-
name:=namesgenerator.GetRandomName(0)
33+
name:=GetRandomName(t)
3434
returnstrings.ReplaceAll(name,"_","-")
3535
}
3636

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp