DEV Community

Discussion on: What do you do while waiting for tests to finish running?

Collapse
 
sergio profile image
deleteme deleteme • Edited

When I work in Rails: Read some news or watch some funny clips on youtube.

When I work in Elixir: No time to do anything really the tests run super quick. My longest time was 7 seconds and that was for about 800 tests.

https://i.imgur.com/IOnmN84.png

Collapse
 
maestromac profile image
Mac Siri

Hahaha, that picture is so appropriate. 800 tests in under 10 seconds is a dream for me.

Collapse
 
dangolant profile image
Daniel Golant

Curious what the real-world average spec/second count is in Rails world. Our suite clocks in at 886 specs in ~14.5s.

Thread Thread
 
maestromac profile image
Mac Siri

Wow dan, how many of those are feature and/or request specs? What's your secret to making the suit so fast?

Thread Thread
 
dangolant profile image
Daniel Golant

IDK how many exactly, but I would say we have a decent amount. We don't do controller specs, so anything that test above the model/interactor is a request spec, though that gets tricky when we try to observe internal behavior.

Does your team use RackAttack or something similar for throttling? A colleague of mine figured out that a significant amount of time was being eaten up by testing throttling behavior. We tried just disabling the throttling, or adjusting the throttle threshold in before blocks, but that ended up causing other tests to flake, so I think the "final" fix was messing around with RackAttack's internal counter when throttling behavior gets tested and then resetting it to normal limits.

Thread Thread
 
dangolant profile image
Daniel Golant

We should get together and talk shop sometime, now that I too am a Rails dev :D

Thread Thread
 
maestromac profile image
Mac Siri

Yes we should :)