Skip to content

Commit

Permalink
Fix es_objects plugin limit order processing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Aug 8, 2022
1 parent d54da7e commit 9f73a47
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/elasticsearch/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,13 +307,17 @@ BOOST_AUTO_TEST_CASE(elasticsearch_objects) {

es.endpoint = es.index_prefix + "limitorder/_doc/_count";
es.query = "";
res = graphene::utilities::getEndPoint(es);
j = fc::json::from_string(res);
BOOST_REQUIRE( j.is_object() );
const auto& obj = j.get_object();
BOOST_REQUIRE( obj.find("count") != obj.end() );
total = obj["count"].as_string();
BOOST_CHECK( total == "0" ); // the limit order expired, so the object is removed
fc::wait_for( ES_WAIT_TIME, [&]() {
res = graphene::utilities::getEndPoint(es);
j = fc::json::from_string(res);
if( !j.is_object() )
return false;
const auto& obj = j.get_object();
if( obj.find("count") == obj.end() )
return false;
total = obj["count"].as_string();
return (total == "0"); // the limit order expired, so the object is removed
});

}
}
Expand Down

0 comments on commit 9f73a47

Please sign in to comment.