Ctrl K
QA · Senior · Coding

There's a UI test: it creates an order through the API for a shared test user, waits two seconds with sleep, opens the order list, and checks that the first order in the list is the one just created. In a parallel run the test fails about one time in ten. Name the causes and rewrite the test so it becomes stable.

~15 min by voice

How to approach it

They're checking whether you can find the real causes of a flaky test instead of hiding them. Here there are two: a race between parallel tests over shared data, and the order appearing in the list asynchronously. They also look at whether you can rewrite the test with isolated data, lookup by id, and a condition-based wait with a timeout.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsAbout five percent of the automated tests in CI fail every now and then without any code changes. How would you deal with that? Mid-levelWhat are flaky automated tests, where do they come from, and what do you do about them? JuniorHow do you systematically deal with flaky automated tests in a large test suite? Senior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~15 min