Repository navigation
test(core): Wait for the transaction capture in idle timeout tests - #6360
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
SentryTracer.finish() clears isFinishTimerRunning before it calls captureTransaction, so waiting on the flag could return while the timer thread was still finishing. Retry the verify until the capture happens instead. Co-Authored-By: Nelson Osacky <nelson.osacky@sentry.io>
📲 Install BuildsAndroid
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Two idle-timeout tests in
SentryTracerTestnow wait forcaptureTransactionitself (await.untilAsserted { verify(...) }) instead of waiting forisFinishTimerRunningto become false:when idle transaction with children, finishes the transaction after the idle timeoutwhen trimEnd, trims idle transaction time to the latest child timestamp💡 Motivation and Context
Between Oct 15 and Oct 22,
when idle transaction with children…failed 3 times withWanted but not invoked: scopes.captureTransaction(...).When the idle timer fires, it calls
SentryTracer.finish().finish()callscancelIdleTimer(), which clearsisIdleFinishTimerRunningbeforecaptureTransactionruns. As a result,await.untilFalse(isFinishTimerRunning)could return while the timer thread was still finishing. ThetrimEndtest uses the same pattern.💚 How did you test it?
Locally (JDK 21),
:sentry:test --tests io.sentry.SentryTracerTest:finish()right beforecaptureTransaction(not committed). With that sleep, both tests fail onmainand pass with this PR. No otherSentryTracerTesttest failed under the sleep.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
None.
#skip-changelog
via no.
--
View Junior Session [Sentry]