{
  "id": 22777790,
  "title": "Make AI-Written Workers Pass the Crash-After-Commit Test",
  "url": "https://urgent.news/2026/11/30/make-ai-written-workers-pass-the-crash-after-commit-test",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-30T12:26:22.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/tercelyi/make-ai-written-workers-pass-the-crash-after-commit-test-4090"
  },
  "original_language": null,
  "account": null,
  "summary": "The article discusses the importance of testing background workers, specifically in the context of AI-written code. It highlights the need to ensure that workers can handle failures and recover correctly, particularly when dealing with tasks that are expensive to verify. The article provides a concrete example of testing a background worker that sends an invoice through an external API. It outlines three tests to consider: before the destination records a request, after the destination commits, and after storing the response before acknowledging the queue. The article emphasizes the importance of checking the destination's behavior at the failure boundary, recording durable state before and after the worker restarts, and verifying that the destination still has the expected invoice count. It also stresses the need for clear acceptance criteria, such as checking the destination's count, the durable state after restart, and the external invoice ID in the receipt. The article concludes by advising that if the destination does not offer a safe replay or reliable lookup, it is better to keep the result unknown and provide an operator with a specific record to investigate before attempting another side effect.",
  "summary_source": "urgent.news",
  "key_points": [],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}