[SERVER-62331] Improve the assert.soon to print the obtained value tested against the conditional value and improve an automation test Created: 31/Dec/21  Updated: 30/Oct/23  Resolved: 30/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Mathis Bessa Assignee: Joseph Prince
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Service Arch 2023-10-30, Service Arch 2023-11-13
Participants:
Linked BF Score: 15

 Description   

We should improve tenant_migration_donor_unblock_reads_and_writes_on_completion.js in order to check if a command was successful by using 
assert.commandWorked instead of just calling runCommand. 

-> Handle the return value in the startReadThread method. In the second test case we have the test expect the read command to actually fail. We should test before doing the assert.soon to avoid any hanging for 10 mins (even if the command succeeded maybe the operation itself failed and the numread will remain 0).
 
We should also improve assert.soon error message to print out the value obtained against the value it's tested. For instance, instead of :
Error: assert.soon failed: () => TenantMigrationUtil.getNumBlockedReads(laggedSecondary, tenantId) == 1
 
We should print 
Error: assert.soon failed: () => TenantMigrationUtil.getNumBlockedReads(laggedSecondary, tenantId) valuehere == 1

The bottom line is that somehow that startReadThread function seem to have thrown before even calling the read method due to a connectivity error this resulted in the getNumBlockedReads to stay at 0 since the read never happened.

 



 Comments   
Comment by Githook User [ 30/Oct/23 ]

Author:

{'name': 'Joseph Prince', 'email': 'joseph.d.prince@me.com', 'username': 'josephdprince'}

Message: SERVER-62331 Add timeout and error message to assert.soon in a tenant migration test
Branch: master
https://github.com/mongodb/mongo/commit/edd9e1d16f69a8e6affb7daab1f0dba9b340738f

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