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(scaletest/workspacetraffic): wait for non-zero metrics before cancelling in TestRun#9663

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
johnstcn merged 3 commits intomainfromcj/flake-workspacetraffic-testrun-pty
Sep 13, 2023

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedSep 13, 2023
edited
Loading

Hopefullyfixes#9661

@johnstcnjohnstcn changed the titlefix(scaletest/workspacetraffic): TestRun: wait for non-zero metrics before cancellingfix(scaletest/workspacetraffic): wait for non-zero metrics before cancelling in TestRunSep 13, 2023
@johnstcnjohnstcn marked this pull request as ready for reviewSeptember 13, 2023 14:03
Copy link
Member

@mtojekmtojek left a comment

Choose a reason for hiding this comment

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

Fingers crossed!

require.NoError(t, runner.Run(ctx, "", &logs), "unexpected error calling Run()")

gotMetrics := make(chan struct{})
go func() {
Copy link
Member

Choose a reason for hiding this comment

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

nit: I'm always confused if there is a possibility of a routine leak. defer goes first then routine is killed, right?

Copy link
MemberAuthor

@johnstcnjohnstcnSep 13, 2023
edited
Loading

Choose a reason for hiding this comment

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

Defer runs when the surrounding function returns. Soassert.Eventually() has to finish beforegotMetrics is closed, and<-gotMetrics will block until that happens. Then we cancel the context passed torunner.Run, which will cause it to exit, then we closerunDone, which unblocked<-runDone.

I thinkgoleak would have caught a goroutine leak here as well.

mtojek reacted with thumbs up emoji
@johnstcnjohnstcn merged commit3be783b intomainSep 13, 2023
@johnstcnjohnstcn deleted the cj/flake-workspacetraffic-testrun-pty branchSeptember 13, 2023 14:54
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 13, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

@mtojekmtojekmtojek approved these changes

@spikecurtisspikecurtisAwaiting requested review from spikecurtis

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

test flake: scaletest/workspacetraffic TestRun/PTY
3 participants
@johnstcn@mafredri@mtojek

[8]ページ先頭

©2009-2025 Movatter.jp