Currently in Evergreen CI, most of our variants run a single Evergreen task, called "test" which in turns runs a Gradle build with a single Gradle task, also called "test". The slowest variant (typically executing against a sharded cluster) can take over 45 minutes to complete. This slows down the feedback loop when running patch builds.
We can increase concurrency quite simply by dividing the tests into more granular buckets and executing them concurrently in separate tasks. The simplest way to do that is by Gradle module. Here's one such division:
- Unit tests: bson:test bson-kotlin:test bson-kotlinx:test bson-scala:test bson-record-codec:test mongodb-crypt:test
- Sync tests: driver-sync:test driver-kotlin-sync:test
- Reactive tests: driver-reactive-streams:test driver-kotlin-coroutine:test
- Other: driver-core:test driver-legacy:test
Note that Scala tests are already separated into their own tasks.
Note also that the unit tests don't need to run against every version and topology of MongoDB the way the integration tests do.
The slowest of these Gradle tasks is driver-sync:test. On an 8.0 sharded clusters it takes about 22 minutes (compared to over 45 to run all tests). So we get initial feedback about twice as fast.
Note that while this will improve the optimal "makespan" (the wall clock time to run all the tasks), it will increase the "time taken" (the sum of all the task execution times) since there is compilation and other set up overhead that has to be repeated for each task (this works out to about 3 minutes for each additional task).