You dont run unit tests concurrently. Do you?:
1.) The surprising reason of introducing test concurrency in our project (not performance)
2.) Test concurrency granularities
3.) Handling test concurrency step by step
4.) Dealing with non-threadsafe codebase
1. You don’t run unit tests concurrently.
Do you?
30 January 2015
Martin Škurla, Equities IT, Core team
2. 2 | You don’t run tests concurrently. Do you? | 30 January 2015
Why ?
3. 3 | You don’t run tests concurrently. Do you? | 30 January 2015
Performance
4. 4 | You don’t run tests concurrently. Do you? | 30 January 2015
Performance
5. 5 | You don’t run tests concurrently. Do you? | 30 January 2015
Performance
Isolation
6. 6 | You don’t run tests concurrently. Do you? | 30 January 2015
Test granularities
7. 7 | You don’t run tests concurrently. Do you? | 30 January 2015
Test suites
8. 8 | You don’t run tests concurrently. Do you? | 30 January 2015
Test suites
Test classes
9. 9 | You don’t run tests concurrently. Do you? | 30 January 2015
Test suites
Test classes
Test methods
10. 10 | You don’t run tests concurrently. Do you? | 30 January 2015
How?
11. 11 | You don’t run tests concurrently. Do you? | 30 January 2015
1. Minize the shared state
12. 12 | You don’t run tests concurrently. Do you? | 30 January 2015
1. Minize the shared state
2. Guard the necessary shared state
13. 13 | You don’t run tests concurrently. Do you? | 30 January 2015
1. Minize the shared state
2. Guard the necessary shared state
3. Understand the framework‘s thread model
14. 14 | You don’t run tests concurrently. Do you? | 30 January 2015
1. Minize the shared state
2. Guard the necessary shared state
3. Understand the framework‘s thread model
4. External integration also needs to be thread safe
15. 15 | You don’t run tests concurrently. Do you? | 30 January 2015
Failback
16. 16 | You don’t run tests concurrently. Do you? | 30 January 2015
@Test(singleThreaded=true)
JVM forking
17. 17 | You don’t run tests concurrently. Do you? | 30 January 2015
Isolation
Test methods granularity
1. Minize the shared state
2. Guard the necessary shared state
3. Understand the framework‘s thread model
4. External integration also needs to be thread safe