Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue #192: When the launchId parameter is specified, all child processes would hang until the entire test set execution was completed. #194

Merged
merged 6 commits into from
Jun 20, 2024
3 changes: 0 additions & 3 deletions lib/cypressReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ class CypressReporter extends Mocha.reporters.Base {
});

this.runner.on(EVENT_RUN_END, () => {
if (CypressReporter.reporterOptions.launchId) {
return;
}
CypressReporter.calcTotalLaunches();
if (CypressReporter.shouldStopLaunch()) {
this.worker.send({ event: EVENT_RUN_END, launch: getLaunchStartObject(config) });
Expand Down
25 changes: 14 additions & 11 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,20 @@ class Reporter {
}

runEnd() {
const finishLaunchPromise = this.client
.finishLaunch(
this.tempLaunchId,
Object.assign(
{
endTime: new Date().valueOf(),
},
this.launchStatus && { status: this.launchStatus },
),
)
.promise.then(() => {
const basePromise = this.config.reporterOptions.launchId
? this.client.getPromiseFinishAllItems(this.tempLaunchId)
AmsterGet marked this conversation as resolved.
Show resolved Hide resolved
: this.client.finishLaunch(
this.tempLaunchId,
Object.assign(
{
endTime: new Date().valueOf(),
},
this.launchStatus && { status: this.launchStatus },
),
).promise;

const finishLaunchPromise = basePromise
.then(() => {
const { launch, isLaunchMergeRequired } = this.config.reporterOptions;
if (isLaunchMergeRequired) {
deleteMergeLaunchLockFile(launch, this.tempLaunchId);
Expand Down