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

fix(cli): scope context per subtest to fix flake test in prebuilt workspace delete#18872

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

ssncferreira
Copy link
Contributor

@ssncferreirassncferreira commentedJul 15, 2025
edited
Loading

Description

This PR fixes a flaky test inTestDelete/Prebuilt_workspace_delete_permissions:coder/internal#764

Previously, all subtests used the same context created at the top level. Since the subtests run in parallel, they could run for too long and cause the shared context to expire. This sometimes led to context deadline exceeded errors, especially during thetestutil.Eventually check for running prebuilt workspaces.

The fix is to create a fresh context per subtest, ensuring they are isolated and not prematurely cancelled due to other subtests' durations.

@ssncferreirassncferreira changed the titlefix(cli): flake test in prebuilt workspace delete by scoping context per subtestfix(cli): scope context per subtest to fix flake test in prebuilt workspace deleteJul 15, 2025
Copy link
Member

@ethanndicksonethanndickson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍 - shoutout spike's blog post on this topic:https://coder.com/blog/go-testing-contexts-and-t-parallel

@ssncferreirassncferreira merged commitf1eec2d intomainJul 15, 2025
34 checks passed
@ssncferreirassncferreira deleted the ssncferreira/fix-flake-cli-prebuilt-delete-ctx branchJuly 15, 2025 09:21
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJul 15, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

@ethanndicksonethanndicksonethanndickson approved these changes

Assignees

@ssncferreirassncferreira

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@ssncferreira@dannykopping@ethanndickson

[8]ページ先頭

©2009-2025 Movatter.jp