Urgent.News

What's breaking now, across thousands of outlets.

Tech

Make an order-dependent test reproducible before handing it to a coding agent

This tutorial was drafted with AI assistance. Its small JavaScript fixture was executed locally; it is not a production incident report. A test that passes alone and fails after another test is often called flaky. That label describes the symptom, but it is a poor implementation brief. Before assigning a repair, make the order dependence explicit. This example uses a shared cache. It gives a…

To ensure a reproducible order-dependent test before handing it to a coding agent, first reduce the issue to two individual tests. One test warms a service while the other verifies the fixture starts empty. Save these tests in a JavaScript file and execute them using Node.js. The first test populates a shared cache, while the second checks the cache size after the first test has executed. Run the tests in both warm-cold and cold-warm orders to observe any state leakage.

If the cold test fails after the warm test, it indicates a shared cache causing the fixture to start with a pre-existing state. Document the failure by running the tests individually and noting the cached size. The original test suite should still pass ten consecutive runs when using fresh caches for each test. The goal is to identify the source of the problem and isolate the fix.

When rewriting the assignment for a coding agent, focus on the underlying issue rather than generic solutions like adding retries or reordering the suite. Clearly state that the cold-fixture test fails after the warm-cache test due to shared cache ownership. Provide instructions to run the tests in the specified order, both independently and together, and record all commands and output.

The scope should involve giving each test its own independently owned fixture, modifying test setup, and preserving production cache behavior.

The acceptance criteria should ensure both orders pass with fresh fixtures, while the cold test still requires an empty cache and the warm test still verifies the returned greeting. Any patch provided should reproduce the failure before the fix and verify the fix's success afterward. The human runner should have a separate operating checklist to confirm the repository and environment, reproduce the failure, inspect fixture ownership in the patch, ensure production behavior and assertions remain intact, and return the exact test output along with any unresolved questions.

This approach ensures a focused repair that addresses the root cause without introducing new dependencies.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A Colleague Wants Your Notes on Their Talk Before Thursday

A colleague has a talk at a meetup on Thursday evening. On Tuesday they ask if you would watch a run through and tell them what you think.

  • Colleague requests notes and feedback on Thursday talk, with only two days to improve.
  • Audience engagement observation is crucial; avoid reading from slides.
  • Focus feedback on three key points, prioritizing time management and clarity.

altcheck: draft alt text and contrast fixes with a local open vision model

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸 This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle What I Built altcheck is a small…

  • altcheck tool generates alt text & contrast fixes
  • Uses local open vision model (SmolVLM-500M-Instruct)
  • Designed for freelancers to improve client page accessibility

I built a zero-backend chess audit tool using Stockfish WASM and client-side processing

Hey dev.to community! 👋 I wanted to share a browser-based tool I recently built: Chess Blunder Heatmap. Instead of focusing on single-game move-by-move engine analysis, the app aggregates a player’s…

  • Chess Blunder Heatmap tool aggregates player game history
  • Stockfish WASM engine runs client-side in browser
  • No backend required, all processing occurs locally

More from Wednesday 14 October →