DEV Community

What do you do while waiting for tests to finish running?

Jess Lee on January 16, 2019

Depending on what I'm working on, some tests take just long enough to run that I get distracted and move on to a totally different task (responding...
Collapse
 
jess profile image
Jess Lee

...and yes I wrote this post while waiting for a test to run :)

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 :)

Collapse
 
ananyaneogi profile image
Ananya Neogi • Edited

Hah! Guess who's checking dev.to right now while waiting for tests to run? Me😂

Most of the times, I would check out some articles from my endless list of bookmarks. I also tend to scroll through twitter or instagram(guilty!) but I am practising to reduce consumption of social media so instead I now force myself to have few sips of water and go around for a quick walk or at least do a little bit of leg stretching. 🙂

Collapse
 
jess profile image
Jess Lee

Oh yeah, that's definitely the right move! I should get up from my seat more.

Collapse
 
maestromac profile image
Mac Siri

Groan about the slow testing speed and plot a plan to improve it.

Collapse
 
rhymes profile image
rhymes

Same here!

Collapse
 
lightalloy profile image
Anna Buianova

Choosing the SSD to buy, in my case :D

Collapse
 
qm3ster profile image
Mihail Malo • Edited

Didn't realize there are options besides Samsung 970 Pro.
What are you thinking?

Collapse
 
moopet profile image
Ben Sinclair

Wait, you're supposed to run tests?

Collapse
 
molly profile image
Molly Struve (she/her)

I am a Site Reliability Engineer so when specs are running I am usually checking up on services. We use Datadog for monitoring and I will go in there and look at dashboards for things like Redis, Elasticsearch, and MySQL. We have alerts if anything breaks but I like looking at historical graphs to see if there are any interesting trends that might be worth investigating.

Collapse
 
jess profile image
Jess Lee

That's a great call, thanks for sharing! I'm going to start doing this more.

Collapse
 
rhymes profile image
rhymes

I think: "how can I make them faster?" 🤣

Collapse
 
kritner profile image
Russ Hammett

xkcd.com/303/ applies to tests running as well IMO

Collapse
 
codingmindfully profile image
Daragh Byrne

Snap!

Collapse
 
thebouv profile image
Anthony Bouvier

Was looking to see if this was posted, cause I was going to!

:D

Collapse
 
shiling profile image
Shi Ling

If the tests are under 10 minutes, I usually stay within my IDE, and start cleaning up code and improving documentation - these are small quick things I could do but they are endless hahaha.

If it's any longer, I shift my tests to a secondary monitor and go do big tasks and come back to the tests when I feel like it.

Collapse
 
shiling profile image
Shi Ling

Although sometimes I do get sucked into refactoring for too long and forget about the test...

Collapse
 
phillie profile image
Philly • Edited

I’m either silently moaning all the time or ending up on Twitter or dev.to bookmarking posts I wanna read (but probably never will). But either way, always having a coffee first! 🤷‍♀️

I often meet my fav co-worker at the coffee machine - in that case we‘d be happily moaning together. 😅

Collapse
 
scottishross profile image
Ross Henderson

Tests?

Collapse
 
jess profile image
Jess Lee

😂

Collapse
 
marceloandrade profile image
Marcelo Andrade R.

I normally don't run all the tests at once, I leave that for the CI server, what I do is run the specific test for the code I'm working on at the moment

Collapse
 
kylegalbraith profile image
Kyle Galbraith

Contemplate the meaning of life.

Who am I kidding? I usually check Twitter, Slack, see what other things might need a code review, etc.

Collapse
 
phallstrom profile image
Philip Hallstrom

Locally when running just the tests affecting my code I wait for them to finish. For the full test run that must pass before I can merge, I'll check the board to see what other PRs are up that I can review (also required to merge).

Collapse
 
victoria profile image
Victoria Drake

Blink.

;)

Collapse
 
maxwell_dev profile image
Max Antonucci
  • Recheck my news feeds
  • Read whatever fiction book I've brought to work that day
  • Kick back and take a small nap
  • Watch some music videos of Off The Hook, a fictional band of two half-squid, half-human performers who sing in some garbled underwater human language. Don't judge, their songs are really catchy!
Collapse
 
wuz profile image
Conlin Durbin

I've been thinking about this a lot recently! Our tests take a bit of time to run and often I will switch to working on another story. I'm not so sure that is the best option however. It's context switching at its worst. I get maybe 15 minutes to work on a new story and if the tests fail, then I have to decide if I want to switch back to the original story or hope that I will remember what I need to do later. It's not a great system.

Sometimes I go and read through Slack or email (or dev.to 😀), but then I don't feel like I am giving my full attention to any of those things either.

I think the best option for me would be to find some clerical or smaller tasks that I can work on between tests, that I could just pick up and put down while they are running.

Collapse
 
michaeljota profile image
Michael De Abreu

You guys have you hourly test, and I'm here just proud of had move the test framework to Jest and now I have like one minute to run all the tests. In that time, I run in another terminals the linter and the production build.

I guess now that we are taking about dead time, in general, most of my dead time is when I turn on my computer on. In work I don't have SSD, though God knows I've requested it, so turn on, and getting all apps (long live to electron) it's about 10 to 15 minutes. I usually get a coffee and play Strike Force...

Collapse
 
lampewebdev profile image
Michael "lampe" Lazarski

1) Reading articles on dev.to or on medium.com

2) Trying out ways to figure out how to push my instagram account.

3) Coffee break with colleagues.

Collapse
 
lauragift21 profile image
Gift Egwuenu

Lol depending on how long it takes. I check my mail or scroll through my twitter timeline.

Collapse
 
lightalloy profile image
Anna Buianova

That's a problem! What works best for me is: planning the next task/actions, summarizing my work. Or doing something not on the computer, like cleaning my desk.

Collapse
 
itsasine profile image
ItsASine (Kayla)

From your Wikipedia link, this caught my eye:

reading for memorization (fewer than 100 words per minute [wpm]); reading for learning (100–200 wpm); reading for comprehension (200–400 wpm); and skimming (400–700 wpm)

I'd think most here are reading for learning, to an extent. 200 WPM sounds like it'd be a good middle between learning and comprehending, though I could just be slow since I tend to read at work while I'm watching tests run.

Just yesterday, I mentioned I'm here when my tests are running :P

Issue being, since I need to run the full regression suite for every story as per the definition of done, I have about an hour every story of doing nothing. Instead of trying to kill my computer having multiple instances of the app up so I can work on multiple things at once, I just read things that vaguely relate to my job. And lately I barely even have one thing to work on, let alone 2, so... here I am :)

Collapse
 
l2aelba profile image
l2aelba • Edited

Pray for that ;(

Collapse
 
razgandeanu profile image
Klaus

I look at the live video stream from the tests, because I'm using Endtest.

Collapse
 
samuraiseoul profile image
Sophie The Lionhart

I'm curious, which test suite takes so long? Are you waiting for unit tests to run or automated browser tests?

Collapse
 
derek profile image
derek

🤞🏽and 🙏🏽 they 💯

Collapse
 
ahmedmusallam profile image
Ahmed Musallam

I feel like when code is deploying or running tests, there needs to be a random gif generator that shows you some entertaining things. Or maybe XKCD comics?

Collapse
 
theianjones profile image
Ian Jones • Edited

Its my Thursday tradition to watch hot ones on some downtime and our test suite definitely allows for that 😅

Collapse
 
jess profile image
Jess Lee

hahha YESSS i love hot ones!!

Collapse
 
foresthoffman profile image
Forest Hoffman

...check dev.to....

Collapse
 
nflamel profile image
Fran C.

My favorite thing to do while I wait is to research what makes them slow to make them go fast so that I don´t have to wait anymore xD

Collapse
 
galdin profile image
Galdin Raphael

I generally cycle through my browser tabs, which keeps me busy 😁

Lately I've been setting 7min timers to play piano exercises because the CI takes about 10min on average and because I work from home!

Collapse
 
codingmindfully profile image
Daragh Byrne • Edited

xkcd.com/303/ - sword fight!

Collapse
 
jdmedlock profile image
Jim Medlock

Review the tests to look for efficiency improvements and most importantly, gaps. :)

Collapse
 
emmabostian profile image
Emma Bostian ✨

Slowly disintegrate.... jk. Sadly I usually turn to Twitter or email

Collapse
 
pretzelhands profile image
pretzelhands

I just read the news. Most builds finish in maybe three minutes, so that's just enough time for a cursory reading of what's going on in the world. :D

Collapse
 
biros profile image
Boris Jamot ✊ /

When I have to wait for my tests run to finish, then I refactor them in order to not have to wait anymore.

Collapse
 
peterwitham profile image
Peter Witham

Most of the time I worry that my tests might have stalled out and obsessively watch the progress bar for movement :)

But usually, it's time to catch up on slack messages and grab more coffee.

Collapse
 
pgangwani profile image
pgangwani • Edited

I run one more test in other repo

Collapse
 
pedrocaseiro profile image
Pedro Caseiro

Review my teammates pull requests :D

Collapse
 
henryjw profile image
Henry Williams

I work on making my tests run faster ;)

Collapse
 
theodesp profile image
Theofanis Despoudis

Reading Dev.to articles of course!

Collapse
 
mskog profile image
Magnus Skog

I pull up the temp graphs on my macbook and pray that this is not the time when it finally burns up.

Collapse
 
sadarshannaiynar profile image
Adarsh

I usually play a 11 point game of ping pong or just listen to a song. If it's an automated UI test I read blog posts since it will take some time.

Collapse
 
lysofdev profile image
Esteban Hernández

Play Runescape on my phone, answer text messages, make some iced tea, go to the restroom, read something on dev.to, talk to the cuties on the UI team, etc.

Collapse
 
jrwren profile image
Jay R. Wren

read twitter.

if I can catch up before the tests are done then I know they are taking WAY too long and I should find a way to make them faster.

Collapse
 
mandarbadve profile image
Mandar Badve

Surfing tweets

Collapse
 
aghost7 profile image
Jonathan Boudreau

I'll start working on a different ticket. I personally don't have a problem with context switching.

Collapse
 
eekayonline profile image
Edwin Klesman

Answer Quora or indiehackers questions.
Write blog post for shipharder.com.
Look at product hunt for new awesome tools.
Upgrade my blog plugins via infinitewp.
Read up on blogs and dev.to 😅