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

Improve the assert.soon to print the obtained value tested against the conditional value and improve an automation test

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • None
    • None
    • Service Arch
    • Fully Compatible
    • ALL
    • Service Arch 2023-10-30, Service Arch 2023-11-13
    • 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.

       

      Attachments

        Activity

          People

            joseph.prince@mongodb.com Joseph Prince
            mathis.bessa@mongodb.com Mathis Bessa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: