fix: refactor mcp and freeze tests to be less prone to flaky results (#8486)

* Fixed mcp test to be less prone to errors

* Fix freeze spec
This commit is contained in:
Lucas Oliveira 2025-06-11 12:02:46 -03:00 committed by GitHub
commit 4cbce28d26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 2 deletions

View file

@ -260,8 +260,6 @@ test(
await page.getByTestId("button_run_chat output").click();
await page.waitForTimeout(3000);
await page.waitForSelector("text=built successfully", {
timeout: 30000 * 3,
});

View file

@ -104,6 +104,35 @@ test(
timeout: 30000,
});
attempts = 0;
dropdownEnabled = false;
await page.waitForTimeout(1000);
while (attempts < maxAttempts && !dropdownEnabled) {
await page.waitForTimeout(3000);
try {
await page.waitForSelector(
'[data-testid="dropdown_str_tool"]:not([disabled])',
{
timeout: 30000,
state: "visible",
},
);
dropdownEnabled = true;
} catch (error) {
attempts++;
console.log(`Retry attempt ${attempts} for second refresh button`);
await page.getByTestId("refresh-button-sse_url").click();
}
}
if (!dropdownEnabled) {
throw new Error(
"Dropdown did not become enabled after multiple refresh attempts",
);
}
await page.getByTestId("tab_0_stdio").click();
await page.waitForTimeout(2000);