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

・1 min read

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 to a long overdue email, something the opposite of coding, etc.) which results in lots of context switching and re-orientating my focus.

What do you typically end up doing while waiting for tests to run?

I think this question is sort of similar, but with less predictable waiting time:

DISCUSSION (68)
 

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

 

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

 

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

 

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

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

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.

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

 
 

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. πŸ™‚

 

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

 

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

 
 

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

 
 
 

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.

 

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

 

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

 

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. πŸ˜…

 
 

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.

 

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

 
 

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...

 
 
  • 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!
 

Contemplate the meaning of life.

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

 

I work on a product that has some e2e integration tests that can literally take over an hour to run for an ETL process. I will often times review my board and look at upcoming tasks, respond to emails, or research a new technology that interests me. Sometimes I just get up and go outside for a walk...

 

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

 

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.

 

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

 

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

 

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.

 
 

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

 

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.

 

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

 

My tests never take more than a minute or two. Over 180 seconds, and it needs some serious re-factoring, so I'd say "get a cup of coffee" :)

 

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 πŸ˜…

 
 
 

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

 

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

 

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?

 

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

 

🀞🏽and πŸ™πŸ½ they πŸ’―

 

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.

 
 
 
 

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.

 

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

 

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

 
 

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.

 

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

 

Its my Thursday tradition to watch hot ones on some downtime and our test suite definitely allows for that πŸ˜…

 
 
 

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.

 

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

 

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!

 

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

Classic DEV Post from Jul 27 '18

Python 2 VS Python 3

There can be only one.

Jess Lee
Taiwanese American based in Brooklyn. Finding, coding, and operating things at dev.to πŸ‘©πŸ»β€πŸ’»
Join dev.to ❀️

The heartbeat of the software industry.