Skip to content

Comments

fix: handle init selectivity error#1201

Merged
KuznetsovRoman merged 1 commit intomasterfrom
TESTPLANE-882.init_selectivity
Feb 12, 2026
Merged

fix: handle init selectivity error#1201
KuznetsovRoman merged 1 commit intomasterfrom
TESTPLANE-882.init_selectivity

Conversation

@KuznetsovRoman
Copy link
Member

No description provided.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

Open in StackBlitz

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

commit: ded3cfc

await Promise.all([cssSelectivity.start(), jsSelectivity.start()]);
await Promise.allSettled([cssSelectivity.start(), jsSelectivity.start()]).then(async ([css, js]) => {
if (css.status === "rejected" || js.status === "rejected") {
await Promise.all([cssSelectivity.stop(true), jsSelectivity.stop(true)]);
Copy link
Member Author

Choose a reason for hiding this comment

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

Cant throw when drop=true is passed

await Promise.all([cssSelectivity.stop(true), jsSelectivity.stop(true)]);

const originalError =
css.status === "rejected" ? css.reason : js.status === "rejected" ? js.reason : "unknown reason";
Copy link
Member Author

Choose a reason for hiding this comment

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

"unknown reason" path is impossible, but typescript wants to be 100% sure

const originalError =
css.status === "rejected" ? css.reason : js.status === "rejected" ? js.reason : "unknown reason";

throw new Error(`Selectivity: Couldn't start selectivity: ${originalError}`);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we'll lose stack and cause of original error if they are present. I'd use throw new Error('...message', {cause: originalError}) to preserve all originalError data.

Copy link
Member Author

@KuznetsovRoman KuznetsovRoman Feb 12, 2026

Choose a reason for hiding this comment

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

Will fix it in next PR in multiple places to avoid rebases

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-882.init_selectivity branch from 463d373 to ded3cfc Compare February 12, 2026 18:59
@KuznetsovRoman KuznetsovRoman merged commit 7eced30 into master Feb 12, 2026
7 checks passed
@KuznetsovRoman KuznetsovRoman deleted the TESTPLANE-882.init_selectivity branch February 12, 2026 19:08
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