Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5628

Increase concurrency of test execution in CI

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 5.3.0
    • Affects Version/s: None
    • Component/s: Evergreen
    • None
    • Java Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

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

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: