Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55202

Add assertion if migration committed or aborted in TenantMigrationTest fixture

    • Fully Compatible
    • v4.9
    • Repl 2021-05-17

      Currently in the TenantMigrationTest fixture, runMigration() and waitForMigrationToComplete() will return if the migration has committed or aborted. This is by design – to confirm if the migration has committed or aborted, we check the state of the result in each individual JS test ( here is an example ).

      However, this can be confusing for tests that assume that the migration will be committed, and it seems easy to forget to check the state after calling runMigration(). We should probably add some additional utility assertion functions that will directly assert that the migration committed or aborted. Maybe the above example could be converted to something like:

      tenantMigrationTest.assertAborted(tenantMigrationTest.waitForMigrationToComplete(...));

      or maybe we could add the new assertions to assert.js.

            Assignee:
            wenbin.zhu@mongodb.com Wenbin Zhu
            Reporter:
            xuerui.fa@mongodb.com Xuerui Fa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: