Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Sleeps, retries and longer timeouts as 'fixes' card 1 of 6

The flaky test that went green in a minute

builds on: Patching the symptom instead of the cause, Race conditions and interleavings
You asked the agent to fix a test that fails about one run in ten. A minute later: *"Root cause was timing. Added a short wait before the assertion; 50/50 runs green locally."* CI is green too. Other versions of the same report: *"added a retry around the flaky call"* or *"raised the timeout to 30 s"*. Did any of these fix the problem?
Terms on this card
CI
Continuous integration: a server that builds the code and runs the tests automatically on every push or pull request.
flaky
A test that sometimes passes and sometimes fails on the same code, usually because of timing or shared state.
timeout
A maximum time to wait for something before giving up with an error.
assertion
A check in a test that fails the test if a stated condition is false.
the agent
The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
Learn this step by step on Bytewise
Lesson goal: Recognise a race 'fixed' with a sleep, a flaky call wrapped in a retry loop, or a raised timeout. Explain why these pass locally and in CI but fail under load or on slower machines, and what a real ordering fix looks like. · the whole lesson