Skip to content

fix(selectivity): memory-leak when calculating testplane-deps#1203

Merged
KuznetsovRoman merged 1 commit intomasterfrom
TESTPLANE-891.fix_testplane_selectivity_mem_leak-1
Feb 12, 2026
Merged

fix(selectivity): memory-leak when calculating testplane-deps#1203
KuznetsovRoman merged 1 commit intomasterfrom
TESTPLANE-891.fix_testplane_selectivity_mem_leak-1

Conversation

@KuznetsovRoman
Copy link
Member

No description provided.

enableCollectingTestplaneDependencies();

const store = { jsTestplaneDeps: new Set<string>() };
const store: { jsTestplaneDeps?: Set<string> } = { jsTestplaneDeps: new Set() };
Copy link
Member Author

Choose a reason for hiding this comment

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

After "fn" completion, "store" is reachable in CDP ping interval callback, so it never GC-removed

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 11, 2026

Open in StackBlitz

npm i https://pkg.pr.new/gemini-testing/testplane@1203

commit: 629d790


return testDependenciesStorage.run(store, fn);
return testDependenciesStorage.run(store, fn).finally(() => {
delete store.jsTestplaneDeps;
Copy link
Member Author

Choose a reason for hiding this comment

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

Thats why we do it manually.
Removing "jsTestplaneDeps" is enough, and, if someone has pointer to it, its not cleared

Copy link
Member

Choose a reason for hiding this comment

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

Probably worth leaving a comment

Copy link
Member

@shadowusr shadowusr left a comment

Choose a reason for hiding this comment

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

🔥


return testDependenciesStorage.run(store, fn);
return testDependenciesStorage.run(store, fn).finally(() => {
delete store.jsTestplaneDeps;
Copy link
Member

Choose a reason for hiding this comment

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

Probably worth leaving a comment

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-891.fix_testplane_selectivity_mem_leak-1 branch 2 times, most recently from 02fa901 to 66c4ae6 Compare February 12, 2026 19:13
@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-891.fix_testplane_selectivity_mem_leak-1 branch from 66c4ae6 to 629d790 Compare February 12, 2026 19:15
@KuznetsovRoman KuznetsovRoman merged commit 03a5228 into master Feb 12, 2026
7 checks passed
@KuznetsovRoman KuznetsovRoman deleted the TESTPLANE-891.fix_testplane_selectivity_mem_leak-1 branch February 12, 2026 19:18
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.

2 participants

Comments