Loading…
Loading…
This test passes on every developer machine and fails in CI roughly one run in four:
1@Test
2void searchReturnsMatchingProducts() {
3 driver.get(baseUrl + "/catalog");
4 driver.findElement(By.id("search")).sendKeys("desk");
5 Thread.sleep(2000);
6 List<WebElement> cards = driver.findElements(By.cssSelector("[data-testid='product-card']"));
7 assertFalse(cards.isEmpty(), "expected search results");
8 assertTrue(cards.get(0).getText().toLowerCase().contains("desk"));
9}CI facts: containers are limited to 0.5 CPU, and the catalog API can take up to 1.5 seconds under the slow-api-response condition. Locally the API responds in about 40ms.
Your task: explain the mechanism of the failure, rewrite the test, and answer the question that follows in every interview: "Someone suggests wrapping it in a retry. What do you say?"
Write your own answer first — the defect report, the case table, the locator, whatever the question asks for. An interviewer grades your reasoning, not your recall.
Practice this live with an AI interviewer
Starts a QA mock interview pre-filled with this problem — you can edit the brief before starting.