Waiting is boring
Filipe Freire - 30 September 2017
Slide 2
Slide 2 text
Quick intro
Husband, learner, tester, developer
(new) OS contributor
2y work as a “coding” tester
1y work as a developer
2
Currently @
Slide 3
Slide 3 text
Disclaimer
This talk is about waiting in software testing.
Expect an imperfect personal account on
problems and solutions.
3
Slide 4
Slide 4 text
What you can take from this
Tips on testing async scenarios in:
A) services with messaging systems
B) frontend apps
C) distributed stream processing apps.
4
Slide 5
Slide 5 text
1) Intro
5
Slide 6
Slide 6 text
–Venkat Subramaniam (twitter, 1 September 2017)
“It’s foolish to wait forever for something to
happen. Both in life and in asynchronous
programming, timeouts are critical.”
6
The context
(new) project
10 person team
Process half million
critical messages p/day
This is just the
beginning (MVP)
57
Slide 58
Slide 58 text
A recent problem
Storm + Scala project
1 small integration (e2e) test suite
Critical sanity/regression checks
Needs to take less than 2-3 min.
How do we handle waits?
58
Slide 59
Slide 59 text
How a typical e2e test works
Topology
Consumer
Event triggered Expected state
?
59
Slide 60
Slide 60 text
Do we hammer 10 sec waits?
Maybe 20 sec?
60
Slide 61
Slide 61 text
Nope. We use what we have at
hand.
61
Slide 62
Slide 62 text
Scalatest’s “eventually”
62
Slide 63
Slide 63 text
How you can do it
63
Slide 64
Slide 64 text
Why is time that important?
64
Slide 65
Slide 65 text
If e2e take 3 mins,
Our current pipeline takes 10 mins
65
Slide 66
Slide 66 text
If e2e take 6 mins (+3)
Our CI/CD pipeline takes 13 mins
10 runs per day
Time wasted per day: 30 mins
Per month: 10 hours
66
Slide 67
Slide 67 text
4) Conclusions
67
Slide 68
Slide 68 text
–Michael Bolton (twitter, September 2017)
“If you’re not scrutinising test code, why do
you trust it any more than your production
code? Especially when no problems are
reported?”
68
Slide 69
Slide 69 text
–Michael Bolton (twitter, September 2017)
“Lesson: don’t blindly trust your test code
or your automated checks, lest they fail to
reveal important problems in production
code.”
69