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: add timeouts to test telemetry snapshot#17879

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
hugodutka merged 2 commits intomainfromhugodutka/test-telemetry-snapshot-timeout
May 22, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutkahugodutka commentedMay 16, 2025
edited
Loading

This PR ensures that waits on channels will time out according to the test context, rather than waiting indefinitely. This should alleviate the panic seen incoder/internal#645 and, if the deadlock recurs, allow the test to be retried automatically in CI.

@hugodutkahugodutka marked this pull request as ready for reviewMay 16, 2025 13:43
Comment on lines 453 to 457
select {
case <-ctx.Done():
t.Fatal("timed out sending deployment")
case deployment <- dd:
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Have a look attestutil.RequireReceive; that provides a nice abstraction over this pattern.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thetestutil.Require* functions were not safe to use from helper goroutines, so I ended up creating 3 new helper functions.

@hugodutkahugodutkaforce-pushed thehugodutka/test-telemetry-snapshot-timeout branch from39cbc5b tocc56091CompareMay 22, 2025 11:06
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

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

LGTM, with a non-blocking nit

// The second return value indicates whether the receive was successful.
//
// Safety: can be called from any goroutine.
func AssertReceive[A any](ctx context.Context, t testing.TB, c <-chan A) (A, bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: could we abstract the logic and either uset.Fatal ort.Error in either case? That seems to be the only delta between the implementations.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

There's also the extra return value. I suppose we could create internal helper functions which would be called with a bool param by the Require/Assert variants. Not sure if it's worth it here - what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah,:shipit:

@hugodutkahugodutka merged commitf825477 intomainMay 22, 2025
34 checks passed
@hugodutkahugodutka deleted the hugodutka/test-telemetry-snapshot-timeout branchMay 22, 2025 11:51
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 22, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@hugodutkahugodutka

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hugodutka@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp