[SERVER-55202] Add assertion if migration committed or aborted in TenantMigrationTest fixture Created: 15/Mar/21  Updated: 29/Oct/23  Resolved: 12/May/21

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 5.0 Desired
Fix Version/s: 4.9.0-rc1, 5.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Xuerui Fa Assignee: Wenbin Zhu
Resolution: Fixed Votes: 0
Labels: pm-1791_non-cloud-blocking, pm-1791_polish
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.9
Sprint: Repl 2021-05-17
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 13/May/21 ]

Author:

{'name': 'Wenbin Zhu', 'email': 'wenbin.zhu@mongodb.com', 'username': 'WenbinZhu'}

Message: SERVER-55202 Add assertion if migration committed or aborted in TenantMigrationTest fixture.

(cherry picked from commit 1cb18cbb349e71cbd869c48c1e288527b48d6d73)
Branch: v4.9
https://github.com/mongodb/mongo/commit/713f6d9ad8cd9d1e01388d978f8fb3268ea79252

Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'Wenbin Zhu', 'email': 'wenbin.zhu@mongodb.com', 'username': 'WenbinZhu'}

Message: SERVER-55202 Add assertion if migration committed or aborted in TenantMigrationTest fixture.
Branch: master
https://github.com/mongodb/mongo/commit/1cb18cbb349e71cbd869c48c1e288527b48d6d73

Generated at Thu Feb 08 05:35:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.