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

Fix and reenable `Interruptible::WaitUntilDeadline` test

    • Fully Compatible
    • v5.0, v4.4
    • Service Arch 2021-08-23
    • 1

      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.

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

              Created:
              Updated:
              Resolved: