Rails Daily

Rails Daily: Test Stability and Live Streaming Fixes

Two pull requests were merged today addressing a flaky Active Record transaction test and fixing an isolation state bug in Action Controller Live streaming.

Duration: PT1M34S

https://podlog.io/listen/rails-daily-a67c65cf/episode/rails-daily-test-stability-and-live-streaming-fixes-48f819a3

Transcript

Good morning, this is Rails Daily for March 1st, 2026.

Two pull requests were merged into the Rails main branch today, both focused on fixing specific issues in the framework.

First, flavorjones merged a fix for flaky test behavior in Active Record's transaction instrumentation tests. The pull request addresses intermittent failures in CI where SQL event counts were inconsistent during savepoint operations. The test was expecting 6 SQL events but occasionally received 7, causing builds to fail unpredictably. The fix adds proper test isolation to prevent event count bleeding between test runs.

Second, tavianator from Shopify merged a correction to Action Controller Live's isolated execution state handling. When using fiber-level isolation, the code was incorrectly passing the original thread to the share_with method instead of the proper execution context. This fix ensures that isolated execution state is properly shared when streaming responses in fiber isolation mode. The pull request includes both the code correction and additional test coverage.

Both changes represent maintenance work that improves Rails' reliability - one fixing test infrastructure stability, the other correcting runtime behavior for applications using Action Controller Live with fiber isolation.

What's next: These fixes will be included in the next Rails release, improving CI stability for contributors and fixing streaming behavior for production applications using fiber isolation.

That's your Rails Daily update. I'm back tomorrow with more Rails development news.