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

The `errorcodes.py` script should not be checking for duplicate error codes in unit-tests

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Service Arch
    • ALL

      It looks like the `errorcodes.py` script is checking for error codes in all source files, including unit-tests. This makes it difficult to ensure in tests whether a specific error code is returned by a function. For example a test, which looks like this:

      ASSERT_EQ(ErrorCodes::Error(50993), decision.getAbortStatus()->code());
      

      Fails to compile with this error:

      [1/3] Checking error codes and waiting for next compile to finish
      FAILED: build/compiler_timestamps/error_code_check.timestamp
      cmd /c C:\Python37\python.exe buildscripts/errorcodes.py -q --list-files  &&  ( echo "" > build\compiler_time
      DUPLICATE IDS: 50993
        src/mongo/db/s/transaction_coordinator_test.cpp:469:33:ErrorCodes::Error(50993
        src/mongo/db/s/transaction_coordinator_util.cpp:551:66:ErrorCodes::Error(50993
      ok: False
      next: 51244
      
      ERRORS DETECTED. To correct, run "buildscripts/errorcodes.py --fix" to replace zero codes.
      Other errors require manual correction.
      

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: