Skip to content
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

fix: flaky TestOriginalSampleRateIsNotedInMetaField #991

Merged
merged 3 commits into from
Feb 14, 2024
Merged

Conversation

robbkidd
Copy link
Member

@robbkidd robbkidd commented Feb 2, 2024

Which problem is this PR solving?

Short description of the changes

  • drop the assumption that only 2 spans are sent to transmission: don't inspect the second event on the transmission queue, inspect the last event

@robbkidd robbkidd marked this pull request as ready for review February 13, 2024 22:12
@robbkidd robbkidd requested a review from a team as a code owner February 13, 2024 22:12
@robbkidd robbkidd added the version: no bump A PR with maintenance or doc changes that aren't included in a release. label Feb 13, 2024
coll.AddSpan(span)
// Find the Refinery-sampled-and-sent event that had no upstream sampling which
// should be the last event on the transmission queue.
var noUpstreamSampleRateEvent *types.Event
assert.Eventually(t, func() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you didn't change this part of the test in this PR. I'm just wondering if using require instead of assert here would be easier to identify failures here. If the assertion for "no-upstream-stampling has failed, the following check won't succeed either.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm a big fan of require—this PR adds it to this test file—and I'm not sure why I didn't use it here.

nodding kermit

Copy link
Contributor

@kentquirk kentquirk left a comment

Choose a reason for hiding this comment

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

Yingrong's comment is appropriate - we should be using require more frequently, and this is a good place to start. But even without that, I'm a huge fan of deflakifying things. Thanks for the attention!

require makes it more clear that the test failed because the event needed for the later assertion never appeared.
Copy link
Contributor

@VinozzZ VinozzZ left a comment

Choose a reason for hiding this comment

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

Thank you for fixing the flaky test and all the beautiful comments 💯

@robbkidd
Copy link
Member Author

Me liberally sprinkling tests and code comments everywhere.
From the movie Peter Pan, a young boy floating in the air shaking a fairy to sprinkle pixie dust on something so that it will float, too.

@robbkidd robbkidd merged commit 5a97440 into main Feb 14, 2024
3 checks passed
@robbkidd robbkidd deleted the robb.flappy-test branch February 14, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working version: no bump A PR with maintenance or doc changes that aren't included in a release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants