Skip to content

Commit

Permalink
unit tests run in US with a loss of precision from NT #6450
Browse files Browse the repository at this point in the history
only: progress
  • Loading branch information
rusefillc committed May 3, 2024
1 parent dffc579 commit 8cd1cb9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions firmware/controllers/system/timer/event_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,18 @@ bool EventQueue::executeOne(efitick_t now) {
return false;
}

#if EFI_UNIT_TEST
// problem: we have a defect - tests are using US not NT so we are comparing apples to oranges here!
// efitick_t spinDuration = current->getMomentNt() - getTimeNowNt();
// if (spinDuration > 0) {
// throw std::runtime_error("Time Spin in unit test");
// }
#endif

// near future - spin wait for the event to happen and avoid the
// overhead of rescheduling the timer.
// yes, that's a busy wait but that's what we need here
// todo: problem: we have a defect - tests are using US not NT so we are comparing apples to oranges here!
while (current->getMomentNt() > getTimeNowNt()) {
UNIT_TEST_BUSY_WAIT_CALLBACK();
}
Expand Down

0 comments on commit 8cd1cb9

Please sign in to comment.