Skip to content

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Aug 22, 2025

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:5044
	Error:      	Received unexpected error:
								POST http://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 multiple workspaces with random names. Two words is not enough to avoid flakes. We have a testutil.GetRandomName function that appends a monotonically increasing integer, but this alternative function that uses hyphens doesn't add that integer. This PR fixes that by just testutil.GetRandomName

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ethanndickson ethanndickson changed the title test: append increasing integer to GetRandomNameHyphenated test: add increasing integer to GetRandomNameHyphenated Aug 22, 2025
@ethanndickson ethanndickson marked this pull request as ready for review August 22, 2025 01:26
@ethanndickson ethanndickson merged commit a71e5cc into main Aug 22, 2025
46 of 47 checks passed
@ethanndickson ethanndickson deleted the ethan/integer-get-random-name-hyphenated branch August 22, 2025 02:20
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy