Repository navigation
test(runtime): leak probe flake fixes; run Catalyst without XCUITest - #603
Merged
Merged
Conversation
The first planted shapes shared one function scope, so their closures shared one context. Anything that kept one of those closures reachable (an object meant to die that a collection had not finalized yet, or a transient retain on one shape's objects) made the whole context, and every shape closing over a variable in it, reachable from a root, and the probe then correctly reported none of those cycles. TNSLeakBlockCycle and TNSLeakSelfHandler failed together that way on the Mac Catalyst lane. Keeping TNSLeakWeakHandler, whose handler shares the context, alive at the snapshot reproduces exactly that pair. Give every shape its own scope, as the later shapes already had.
`./run_tests.sh --catalyst --no-xctest` builds TestRunner for Mac Catalyst and launches the app itself instead of through XCUITest, so it needs no Automation Mode. The runtime's console goes to console.log in the test folder (OS_ACTIVITY_DT_MODE mirrors os_log to stderr), the app is quit once its junit report appears in the test folder's home (CFFIXED_USER_HOME), and the run fails on failing specs, a final summary other than SUCCESS, a crash before the report, or no report within 15 minutes. Without the XCTest host's HTTP server, the specs that need one are skipped.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…a leak probe An explicit release or a collection on another thread hands the native release of an object first wrapped on the runtime's thread to an event loop task. Until that task runs the object is alive with no wrapper, so the probe never walks it, and anything it owns (a JS block whose callback handle is strong) reads as owned from outside, hiding cycles through it. The probe's settle drain now also makes those deferred releases, on the runtime's thread only. The host SPI is unchanged: drainReleases covers them.
The specs in NativeCallbackSelfTests.js (and its beforeEach) settle with several rounds of two full collections each. Under ASan, on the large heap late in the suite, that can outlast Jasmine's default 5 s async timeout, as it did on CI for the owned C function primitive results spec.
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.
Fixes an intermittent failure in the leak probe's "planted shapes" specs, and adds a way to run the Mac Catalyst suite without XCUITest.
Flake
On the Mac Catalyst lane (V8 with JIT, default resurrecting mode), "reports TNSLeakBlockCycle / TNSLeakSelfHandler by default only when it leaks under this mode" failed intermittently while the other shapes passed. Example: run 44962227647 on #595.
mainand on the failing CI tree.main.(Global handles) → callback → shared context.KeepDuringJob;run_tests.sh --catalyst --no-xctestOS_ACTIVITY_DT_MODE=1) into<test folder>/console.log, waits for the junit report or the end marker, then terminates the app, which never quits on its own.--wrapper-lifetime <mode>[:<scope>]: the mode's build setting is passed to the build, and the mode check runs on the report.--asanis rejected.Releases waiting for the runtime's thread
The probe's settle step drained the wrapper-lifetime release queue but not ObjectManager's deferred releases: native releases (and
Block_releases) a finalizer queued because they must run on the runtime's thread. An object waiting there is alive but has no wrapper. The probe never walked it, so anything it owned, such as a JS block whose callback is strong, read as a JS root and could hide a cycle.ObjectManager::RunDeferredReleases(isolate)runs the existingDrainDeferredReleaseswhen called on the runtime's thread, and does nothing elsewhere.drainReleases(used by every settle round) now calls it first. There is no SPI change (kVersionstays 3).Testing
--catalyst --no-xctest2171 specs, 0 failures.--catalyst --no-xctest, 2170 specs, 0 failures: resurrecting/extended, and--wrapper-lifetime canary:all(mode check passed).