Skip to content

Commit

Permalink
Test sequentiell aborts
Browse files Browse the repository at this point in the history
  • Loading branch information
OhKai committed Nov 30, 2023
1 parent c7e9ff3 commit 199acce
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/engine/e2e_tests/process/deployment/deployment.e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ jest.setTimeout(100000);

function killEngineProcess(engineProcess) {
return new Promise((resolve) => {
const i = Math.random();
engineProcess.on('exit', () => {
console.log('engineProcess killed', i);
resolve();
});
engineProcess.on('error', () => {
console.log('engineProcess error', i);
resolve();
});
console.log('engineProcess kill command', i);
engineProcess.kill();
});
}
Expand Down Expand Up @@ -77,11 +81,9 @@ describe('Test deploying a process', () => {

afterAll(async () => {
// kills all processes and their subprocesses
const killCommands = engineProcesses.map((engineProcess) =>
killEngineProcess(engineProcess.process),
);

await Promise.all(killCommands);
for (engineProcess of engineProcesses) {
await killEngineProcess(engineProcess.process);
}
});

beforeEach(() => {
Expand Down

0 comments on commit 199acce

Please sign in to comment.