Skip to content

Commit 06a22f1

Browse files
authored
test: resolve flakiness in --mcp flag test (#19993)
1 parent 732433c commit 06a22f1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/bin/eslint.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,15 +1343,19 @@ describe("bin/eslint.js", () => {
13431343
describe("MCP server", () => {
13441344
it("should start the MCP server when the --mcp flag is used", done => {
13451345
const child = runESLint(["--mcp"]);
1346+
let doneCalled = false;
13461347

13471348
// should not have anything on std out
13481349
child.stdout.on("data", data => {
13491350
assert.fail(`Unexpected stdout data: ${data}`);
13501351
});
13511352

13521353
child.stderr.on("data", data => {
1353-
assert.match(data.toString(), /@eslint\/mcp/u);
1354-
done();
1354+
if (!doneCalled) {
1355+
assert.match(data.toString(), /@eslint\/mcp/u);
1356+
doneCalled = true;
1357+
done();
1358+
}
13551359
});
13561360
});
13571361
});

0 commit comments

Comments
 (0)