Simulation Testing for Background Jobs
summary
Chaotic Job is a Ruby gem that makes retry behavior testable by replaying enqueued jobs in production order, collapsing time and avoiding the PerformingEnqueuedJobs lie. It provides perform_all_jobs and time-bounded flush helpers, a glitch.inject TracePoint layer to inject retriable errors, a macro that generates one test per observed failure point, and a race-tester that samples 200 deterministic interleavings. It is extracted from the acidic_job test suite and is proven useful for finding retry and race bugs in durable Active Job workflows.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 1:55Testing job retries matters
- 4:06Flaws in Rails retry helpers
- 7:02Retry testing with perform helpers
- 13:05Simulating job failures
- 15:14Glitches for controlled failures
- 20:12Declarative failure scenarios
- 21:16Testing all job failure points
- 24:48Race conditions between jobs
- 29:11Summary
related talks
28mFair by design: orchestrating background jobs in Ruby
55mThe Past, Present and Future of Background Job...
24mApplication-Level Chaos Engineering in JVM
33mHow much pressure can your app handle - Performance testing with Ruby
41mInside ActiveJob
41mDeterministic Solutions to Intermittent Failures
43mProperty-Based Testing - Examples from Business Applications
39mAsynchronous Workers to the Resque
