Skip to content

Commit dcb3b53

Browse files
committed
fix(test): wait for async process info update in terminal title test
The "clear stale title after child process exits" test had a race condition on Windows where the flyout label still showed "node.exe" because the async process detection hadn't completed yet. Add an awaitsFor that polls until the flyout label no longer contains "node".
1 parent f56a68d commit dcb3b53

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

test/spec/Terminal-integ-test.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,20 @@ define(function (require, exports, module) {
528528
return title.indexOf("TestCustomTitle") === -1;
529529
}, "stale title to be cleared after exit", 15000);
530530

531+
// Wait for the process info to update (async)
532+
// so the flyout label reflects the shell, not the
533+
// exited child process.
534+
await awaitsFor(function () {
535+
triggerFlyoutRefresh();
536+
const lbl = testWindow.$(
537+
".terminal-flyout-item.active "
538+
+ ".terminal-flyout-title"
539+
).text();
540+
return lbl && lbl.indexOf("node") === -1;
541+
}, "flyout label to show shell instead of node",
542+
15000);
543+
531544
// The flyout label should be back to the shell
532-
triggerFlyoutRefresh();
533545
const label = testWindow.$(
534546
".terminal-flyout-item.active "
535547
+ ".terminal-flyout-title"

0 commit comments

Comments
 (0)