Skip to content
Snippets Groups Projects

fix async timeout

Merged Daniel Hornung requested to merge f-fix-async-timeout into dev
+ 8
4
@@ -53,11 +53,15 @@ TEST(test_async, retrieve_non_existing) {
auto status = transaction->GetStatus();
EXPECT_EQ(status.GetCode(), StatusCode::EXECUTING);
// wait some time
std::this_thread::sleep_for(1000ms);
// 1000ms are not always sufficient, when there is very high pipeline load.
auto count = 1000;
do {
// wait some time
std::this_thread::sleep_for(10ms);
// DONT call WaitForIt -> the transaction finishes in the back-ground
status = transaction->GetStatus();
// DONT call WaitForIt -> the transaction finishes in the background
status = transaction->GetStatus();
} while (--count > 0 && status.GetCode() == StatusCode::EXECUTING);
EXPECT_EQ(status.GetCode(), TransactionStatus::TRANSACTION_ERROR().GetCode());
ASSERT_EQ(status.GetCode(), StatusCode::GENERIC_TRANSACTION_ERROR);
Loading