Skip to content

flake: TestWorkspaceBuildTimings #15073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spikecurtis opened this issue Oct 15, 2024 · 1 comment · Fixed by #15077
Closed

flake: TestWorkspaceBuildTimings #15073

spikecurtis opened this issue Oct 15, 2024 · 1 comment · Fixed by #15077
Assignees
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks

Comments

@spikecurtis
Copy link
Contributor

    workspacebuilds_test.go:1233: 
        	Error Trace:	/home/runner/work/coder/coder/coderd/database/dbgen/dbgen.go:297
        	            				/home/runner/work/coder/coder/coderd/workspacebuilds_test.go:1233
        	            				/home/runner/work/coder/coder/coderd/workspacebuilds_test.go:1302
        	Error:      	Received unexpected error:
        	            	execute transaction:
        	            	    github.com/coder/coder/v2/coderd/database.(*sqlQuerier).runTx
        	            	        /home/runner/work/coder/coder/coderd/database/db.go:145
        	            	  - pq: duplicate key value violates unique constraint "workspace_builds_workspace_id_build_number_key"
        	Test:       	TestWorkspaceBuildTimings
        	Messages:   	insert workspace build

seen here: https://github.com/coder/coder/actions/runs/11341994791/job/31541458830?pr=15072

@spikecurtis spikecurtis added the s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks label Oct 15, 2024
@spikecurtis
Copy link
Contributor Author

The problem is that subtests share a copy of the database, and also share the makeBuild() function and associated state including the build number. The subtests run in parallel, and so there is a race condition on the build number.

At a minimum, the subtests should not share a workspace, and should have their own build numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants