Skip to content

Commit

Permalink
debug CI
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Oct 4, 2024
1 parent 6db9d3d commit a275382
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions test/cxx/MessagePassingTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ namespace tut {
}

void sendMessagesLater() {
std::cout << "sender: sleep 1" << std::endl;
syscalls::usleep(20000);
std::cout << "sender: sending hi" << std::endl;
box->send("hi");
std::cout << "sender: sent hi" << std::endl;
std::cout << "sender: sleep 2" << std::endl;
syscalls::usleep(20000);
std::cout << "sender: sending ho" << std::endl;
box->send("ho");
std::cout << "sender: sent ho" << std::endl;
}
};

Expand Down Expand Up @@ -70,14 +76,17 @@ namespace tut {
TempThread thr(boost::bind(&MessagePassingTest::sendMessagesLater, this));
unsigned long long timeoutUSec = 200000;
Timer<> timer;
std::cerr << "Test 1" << std::endl;
ensure_equals("(1)", box->recv("ho", &timeoutUSec)->name, "ho");
auto m = box->recv("ho", &timeoutUSec);
std::cout << "Done receiving" << std::endl;
if (m == nullptr) {
std::cout << "Timeout" << std::endl;
abort();
}
ensure_equals("(1)", m->name, "ho");
ensure("(2)", timer.elapsed() >= 39);
ensure("(3)", timer.elapsed() <= 250);
ensure_equals("(4)", box->size(), 1u);
std::cerr << "Test 2" << std::endl;
ensure_equals("(5)", box->recv("hi")->name, "hi");
std::cerr << "Test 3" << std::endl;
ensure_equals("(6)", box->size(), 0u);
ensure("(7)", timeoutUSec >= 100000);
}
Expand Down

0 comments on commit a275382

Please sign in to comment.