Skip to content

Commit 125d3ef

Browse files
committed
spec: reduce flakyness
1 parent d9d18b3 commit 125d3ef

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/unixTerminal.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,22 @@ if (process.platform !== 'win32') {
272272
ptyProcess.on('data', function (data) {
273273
if (ptyProcess.process === 'Python') {
274274
console.log('title', ptyProcess.process);
275+
console.log('ready', ptyProcess.pid);
275276
}
276277
});
277-
setTimeout(() => null, 500);
278-
console.log('ready', ptyProcess.pid);
279278
`;
280279
const p = cp.spawn('node', ['-e', data]);
281280
let sub = '';
282281
let pid = '';
283282
p.stdout.on('data', (data) => {
284283
if (!data.toString().indexOf('title')) {
285284
sub = data.toString().split(' ')[1].slice(0, -1);
285+
} else if (!data.toString().indexOf('ready')) {
286+
pid = data.toString().split(' ')[1].slice(0, -1);
286287
setTimeout(() => {
287288
process.kill(parseInt(pid), 'SIGINT');
288289
p.kill('SIGINT');
289290
}, 200);
290-
} else if (!data.toString().indexOf('ready')) {
291-
pid = data.toString().split(' ')[1].slice(0, -1);
292291
}
293292
});
294293
p.on('exit', () => {

0 commit comments

Comments
 (0)