Skip to content

Remove active sleeps in tests#552

Merged
jorgemanrubia merged 1 commit intomainfrom
less-sleepy
Jan 9, 2026
Merged

Remove active sleeps in tests#552
jorgemanrubia merged 1 commit intomainfrom
less-sleepy

Conversation

@jorgemanrubia
Copy link
Member

In general, active delays in tests are a bad practice. They slow the suite down, and they are unreliable.

Capybara comes with automatic waiting for the built-in helpers, we should always try to use those when possible. E.g: if something changes in the screen, assert with a selector the expected change, so that Capybara waits until it happens.

I added a custom wait_until helper method for custom conditions that we can't cover with capybara.

I left a couple of sleeps after pressing keys, since I can't think of a way to avoid those.

@jorgemanrubia
Copy link
Member Author

cc @samuelpecher @zoltanhosszu

@jorgemanrubia jorgemanrubia merged commit f0d2331 into main Jan 9, 2026
5 checks passed
@jorgemanrubia jorgemanrubia deleted the less-sleepy branch January 9, 2026 17:01
@zoltanhosszu
Copy link
Contributor

Ah this is awesome!

@samuelpecher
Copy link
Collaborator

Not sure if it's this or #479. If I rebuild the assets on main they are different and I get this consistent failure:

Failure:
ActionTextLoadTest#test_Clearing_value_of_editor_doesn't_add_trailing_markup [test/system/form_test.rb:70]:
Expected: ""
  Actual: "<p><br></p>"


bin/rails test test/system/form_test.rb:65

This was referenced Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants