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

fix: stop REPL servers on call "halt" method #1019

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Sep 19, 2024

What is done

In the case when the user switches to REPL mode and then someone calls halt method, then Testplane does not end correctly. In this case, it is necessary to explicitly close the repl server in worker. So I did it.

@DudaGod DudaGod force-pushed the TESTPLANE-251.close_repl_on_halt branch from 06c4f57 to aeb19e8 Compare September 19, 2024 11:06
@@ -8,3 +8,7 @@ testplaneFacade.init();
exports.runTest = (fullTitle, options) => {
return testplaneFacade.runTest(fullTitle, options);
};

exports.cancel = () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

I can't stop repl server from master process. So I need to send command to all workers.

@@ -31,6 +31,10 @@ module.exports = class TestplaneFacade {
return this.promise;
}

cancel(): void {
RuntimeConfig.getInstance().replServer?.close();
Copy link
Member Author

@DudaGod DudaGod Sep 19, 2024

Choose a reason for hiding this comment

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

If replServer doesn't exist (user do not use --repl option) then nothing will fail here.

test/src/runner/index.js Outdated Show resolved Hide resolved
@DudaGod DudaGod force-pushed the TESTPLANE-251.close_repl_on_halt branch from aeb19e8 to a527042 Compare September 19, 2024 12:13
@DudaGod DudaGod merged commit 3fcf74d into master Sep 19, 2024
2 checks passed
@DudaGod DudaGod deleted the TESTPLANE-251.close_repl_on_halt branch September 19, 2024 12: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