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: Correctly abort process on timeout #162

Merged
merged 2 commits into from
Apr 8, 2023
Merged

Conversation

MarcoPolo
Copy link
Contributor

No description provided.

Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Thanks for splitting this out into a separate PR.

multidim-interop/src/compose-runner.ts Outdated Show resolved Hide resolved
Comment on lines +50 to +51
const { signal } = controller;
const { stdout, stderr } = await exec(`docker compose -f ${path.join(dir, "compose.yaml")} up ${upFlags.join(" ")}`, { signal })
Copy link
Contributor

Choose a reason for hiding this comment

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

If exec needs an object that has a signal property, can't you just pass controller directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This avoids passing in other things that are in the controller. This is also how you do it per the docs: https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback

@MarcoPolo MarcoPolo merged commit d342ac5 into master Apr 8, 2023
MarcoPolo added a commit to mxinden/test-plans that referenced this pull request Apr 13, 2023
* Pass in abort controller signal

* Rearrange
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