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: we have a problem!
  • Loading branch information
rusefillc committed May 3, 2024
1 parent dffc579 commit c5ffc3b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions firmware/controllers/system/timer/event_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ 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
Expand Down

0 comments on commit c5ffc3b

Please sign in to comment.