feat: exported in-process testing network#24629
Open
Thunkar wants to merge 5 commits into
Open
Conversation
The pure-Node signal/exit handlers in startAnvil only reap anvil when node runs its own handlers (explicit stop, Ctrl+C, normal exit, uncaught exception). On a parent hard-kill (SIGKILL/crash/OOM) they never run, and the detached anvil is orphaned — verified empirically. That is the exact failure the removed anvil_kill_wrapper.sh guarded against and a known source of CI flakiness. Spawn anvil under a small inlined bash watchdog that polls its parent (this node process) and reaps anvil via an EXIT/INT/TERM trap when the parent dies for any reason. Inlined (not a shipped .sh) so it works from the published npm tarball, with the resolved anvil binary passed via $ANVIL_BIN so it works without anvil on PATH.
The watchdog trapped cleanup on EXIT/INT/TERM, but a trapped TERM does not terminate bash — it ran cleanup and then resumed the parent-poll loop, so the supervisor never exited on stop() until killChild's 5s SIGKILL escalation. That 5s collided with jest's 5s hook timeout and hung afterEach teardown (forwarder_l1_tx_utils.test.ts). Trap the kill on EXIT only and have INT/TERM just exit (firing the EXIT trap); use 'sleep & wait' so the poll is interruptible. stop() now returns in ~1s; orphan-on-parent-death still holds.
Collaborator
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
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.
Upstreaming the utilities build for
aztec-kitso external projects can benefit from our e2e scaffolding. Essentially the same thing we already use, but pure ts rather than the unpublishable .sh script. Verified withci-full-no-test-cache