Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Sep 15, 2022
1 parent 941e458 commit 757ea9b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/sequential/test-watch-mode.mjs
Expand Up @@ -183,16 +183,18 @@ describe('watch mode', { concurrency: false, timeout: 60_0000 }, () => {
isReady: (data) => data.startsWith('running'),
});

assert.strictEqual(stderr, '');
const expected = ['running', `Restarting ${inspect(file)}`, 'Waiting for graceful termination...',
'exiting gracefully', `Gracefully restarted ${inspect(file)}`, 'running'].join('\n');

// This message appearing is very flaky depending on a race between the
// inner process and the outer process. it is acceptable for the message not to appear
// as long as the SIGTERM handler is respected.
if (stdout.includes('Waiting for graceful termination...')) {
assert.strictEqual(stdout, ['running', `Restarting ${inspect(file)}`, 'Waiting for graceful termination...',
'exiting gracefully', `Gracefully restarted ${inspect(file)}`, 'running', 'exiting gracefully', ''].join('\n'));
assert(stdout.startsWith(expected));
} else {
assert.strictEqual(stdout, ['running', `Restarting ${inspect(file)}`, 'exiting gracefully', 'running', ''].join('\n'));
assert(stdout.startsWith(removeGraceMessage(expected)));
}
assert.strictEqual(stderr, '');
});

it('should pass arguments to file', async () => {
Expand Down

0 comments on commit 757ea9b

Please sign in to comment.