FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Fixing a stubborn class of flaky Turbo Stream system tests
NewsWeb Development

Fixing a stubborn class of flaky Turbo Stream system tests

via Dev.toGary Passero2h ago

If you've written system tests against a Rails app that uses Turbo Streams, you've probably hit this: the test clicks a button, a background job runs, and a progress bar (or some other element) should update — but the assertion intermittently fails because the DOM hasn't caught up yet. The usual advice is to use Turbo::SystemTestHelper#connect_turbo_cable_stream_sources, which waits for the WebSocket subscription to be established before proceeding. That fixes the most common race condition: a broadcast firing before the browser has connected to the cable stream. But there's a second, less-discussed race condition that connect_turbo_cable_stream_sources doesn't address. The real problem Consider a job that broadcasts twice in sequence — once at 0% and once at 100% when it finishes: # in your job def broadcast_update ( message = nil ) ProgressBar . new ( percent_complete :, result_message :). update ( stream_id ) end And the test: click_on ( 'Update' ) expect ( page ). to have_css ( dat

Continue reading on Dev.to

Opens in a new tab

Read Full Article
0 views

Related Articles

LEGO’s Barcode Computer: The Wildest STEM Toy You Never Heard Of
News

LEGO’s Barcode Computer: The Wildest STEM Toy You Never Heard Of

Medium Programming • 10m ago

Kalshi Has Been Temporarily Banned in Nevada
News

Kalshi Has Been Temporarily Banned in Nevada

Wired • 17m ago

Iran War Puts Global Energy Markets on the Brink of a Worst-Case Scenario
News

Iran War Puts Global Energy Markets on the Brink of a Worst-Case Scenario

Wired • 50m ago

The data from 400,000 developers exposes the grind myth — and shows what actually separates good…
News

The data from 400,000 developers exposes the grind myth — and shows what actually separates good…

Medium Programming • 1h ago

News

Why your next mobile app is probably headless

Lobsters • 1h ago

Discover More Articles