Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seems windows is actually sleeping for much longer than 1ms
Browse files Browse the repository at this point in the history
TrentHouliston committed Sep 1, 2024
1 parent 8950e42 commit b6ac1dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/tests/dsl/IdleSingle.cpp
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@
#include "test_util/TestBase.hpp"
#include "test_util/TimeUnit.hpp"
#include "test_util/common.hpp"
#include "util/precise_sleep.hpp"

namespace Catch {

@@ -58,8 +59,7 @@ class TestReactor : public test_util::TestBase<TestReactor> {
static constexpr int thread_count = 1;
};

explicit TestReactor(std::unique_ptr<NUClear::Environment> environment)
: TestBase(std::move(environment), false, std::chrono::seconds(2)) {
explicit TestReactor(std::unique_ptr<NUClear::Environment> environment) : TestBase(std::move(environment), false) {

/*
* Runs a sync task so that a task can be triggered while the pool is idle.
@@ -70,7 +70,7 @@ class TestReactor : public test_util::TestBase<TestReactor> {
on<Trigger<TaskA>, Pool<>, Sync<TestReactor>>().then([this](const TaskA& t) {
entry_calls[t.i].fetch_add(1, std::memory_order_relaxed);
emit(std::make_unique<TaskB>(t.i));
std::this_thread::sleep_for(std::chrono::milliseconds(1));
NUClear::util::precise_sleep(std::chrono::milliseconds(1));
});

// Run this at low priority but have it first

0 comments on commit b6ac1dd

Please sign in to comment.