Skip to content
Snippets Groups Projects
Commit 000817dc authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Merge branch 'f-fix-async-timeout' into 'dev'

fix async timeout

See merge request !29
parents d17869cf 99860939
No related branches found
No related tags found
Loading
Pipeline #42265 passed
...@@ -19,4 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -19,4 +19,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
* Fixed failing async test.
### Security ### Security
...@@ -53,13 +53,19 @@ TEST(test_async, retrieve_non_existing) { ...@@ -53,13 +53,19 @@ TEST(test_async, retrieve_non_existing) {
auto status = transaction->GetStatus(); auto status = transaction->GetStatus();
EXPECT_EQ(status.GetCode(), StatusCode::EXECUTING); EXPECT_EQ(status.GetCode(), StatusCode::EXECUTING);
// wait some time // 1000ms are not always sufficient, when there is very high pipeline load.
std::this_thread::sleep_for(1000ms); auto count = 1000;
auto code = transaction->GetStatus().GetCode();
do {
// wait some time
std::this_thread::sleep_for(10ms);
// DONT call WaitForIt -> the transaction finishes in the back-ground // DONT call WaitForIt -> the transaction finishes in the background
status = transaction->GetStatus(); code = transaction->GetStatus().GetCode();
EXPECT_EQ(status.GetCode(), TransactionStatus::TRANSACTION_ERROR().GetCode()); } while (--count > 0 && code == StatusCode::EXECUTING);
ASSERT_EQ(status.GetCode(), StatusCode::GENERIC_TRANSACTION_ERROR); ASSERT_GT(count, 0) << "ERROR: Timeout while waiting for transaction.";
EXPECT_EQ(code, TransactionStatus::TRANSACTION_ERROR().GetCode());
ASSERT_EQ(code, StatusCode::GENERIC_TRANSACTION_ERROR);
const auto &result_set = transaction->GetResultSet(); const auto &result_set = transaction->GetResultSet();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment