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

Fix and reenable `Interruptible::WaitUntilDeadline` test

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Service Arch 2021-08-23
    • Story Points:
      1

      Description

      The following assertions may fail when running the test on Evergreen, and SERVER-58958 disabled the test to prevent BFs and commit-queue failures.

      TEST(Interruptible, WaitUntilDeadline) {
          auto interruptible = std::make_unique<DummyInterruptible>();
          const auto sleepFor = Milliseconds(500);
       
          auto mutex = MONGO_MAKE_LATCH();
          stdx::condition_variable cv;
          stdx::unique_lock<Latch> lk(mutex);
       
          const auto start = Date_t::now();
          Date_t deadline = start + sleepFor;
          interruptible->waitForConditionOrInterruptUntil(cv, lk, deadline, []() { return false; });
          const auto end = Date_t::now();
       
          ASSERT_GTE(end, deadline - DummyInterruptible::kPrecision);
          ASSERT_LTE(end, deadline + DummyInterruptible::kPrecision);
      }
      

      This ticket should make the test more resilient to potential OS scheduling issues, or remove the test if doing so is not feasible.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              amirsaman.memaripour Amirsaman Memaripour
              Reporter:
              amirsaman.memaripour Amirsaman Memaripour
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: