Adjusting test case to eventually exit with an error after a reasonable time.
This commit is contained in:
@@ -133,9 +133,8 @@ TEST_CASE("Server Basic Endpoints", "[server_basic]") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait until our DAG is complete
|
// Wait until our DAG is complete
|
||||||
bool complete = false;
|
bool complete = true;
|
||||||
while (!complete) {
|
for (auto i = 0; i < 10; ++i) {
|
||||||
complete = true;
|
|
||||||
auto response = REQUEST(baseURL + "/v1/dagrun/" + std::to_string(runID));
|
auto response = REQUEST(baseURL + "/v1/dagrun/" + std::to_string(runID));
|
||||||
REQUIRE(response.code() == Pistache::Http::Code::Ok);
|
REQUIRE(response.code() == Pistache::Http::Code::Ok);
|
||||||
rj::Document doc;
|
rj::Document doc;
|
||||||
@@ -147,6 +146,7 @@ TEST_CASE("Server Basic Endpoints", "[server_basic]") {
|
|||||||
const auto &taskStates = doc["taskStates"].GetArray();
|
const auto &taskStates = doc["taskStates"].GetArray();
|
||||||
REQUIRE(taskStates.Size() == 3);
|
REQUIRE(taskStates.Size() == 3);
|
||||||
|
|
||||||
|
complete = true;
|
||||||
for (size_t i = 0; i < taskStates.Size(); ++i) {
|
for (size_t i = 0; i < taskStates.Size(); ++i) {
|
||||||
std::string state = taskStates[i].GetString();
|
std::string state = taskStates[i].GetString();
|
||||||
if (state != "COMPLETED") {
|
if (state != "COMPLETED") {
|
||||||
@@ -154,8 +154,10 @@ TEST_CASE("Server Basic Endpoints", "[server_basic]") {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (complete) break;
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
}
|
}
|
||||||
|
REQUIRE(complete);
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(2));
|
std::this_thread::sleep_for(std::chrono::seconds(2));
|
||||||
for (const auto &pth : std::vector<fs::path>{"dagrun_A", "dagrun_B"}) {
|
for (const auto &pth : std::vector<fs::path>{"dagrun_A", "dagrun_B"}) {
|
||||||
|
|||||||
Reference in New Issue
Block a user