Skip to content

test(compression): assert idle eviction terminates at the resource level - #13371

Merged
diegosouzapw merged 1 commit into
release/v3.8.51from
test/port-12542-idle-worker-terminate
Sep 11, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.51from
test/port-12542-idle-worker-terminate

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Carries the test case from #12542 by @pacocartones, whose fix was subsumed by #13091 (merged earlier today, same diagnosis reached independently).

#13091 guards the idle-eviction leak by asserting the worker's exit event fires — that is what separates a terminated thread from a merely dereferenced one. This adds the complementary, resource-level angle: it counts actual terminate() calls and checks that process.getActiveResourcesInfo() does not retain the worker's MessagePort. A regression that drops the slot while leaving the OS handle alive is caught by this one and not by the other.

Verified both directions on the current tip:

with the fix:                       8 pass / 0 fail
with remove() made to skip terminate():  7 pass / 1 fail (this case)

Test-only, plus a maintenance changelog fragment.

⚠️ base-red inherited: #12732

#13091 fixed the idle-eviction leak and guards it by asserting the worker's
`exit` event fires. This adds the complementary angle from #12542: it counts
actual `terminate()` calls and checks `process.getActiveResourcesInfo()` does
not retain the worker's MessagePort, so a regression that drops the slot
without releasing the OS-level handle is caught too.

Verified both directions on the current tip: 8/8 with the fix in place, and
the new case alone fails when `remove()` is made to skip `terminate()`.

Co-authored-by: pacocartones <pacocartones@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit 3f62e43 into release/v3.8.51 Sep 11, 2026
7 of 11 checks passed
Githab-capibara added a commit to Githab-capibara/OmniRoute that referenced this pull request Sep 17, 2026
…vel (diegosouzapw#13371)

Merged as the credit vehicle for diegosouzapw#12542. Reverse-TDD verified on the tip: 8/8 with the fix, 7/8 with `terminate()` disabled.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…vel (diegosouzapw#13371)

Merged as the credit vehicle for diegosouzapw#12542. Reverse-TDD verified on the tip: 8/8 with the fix, 7/8 with `terminate()` disabled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant