Fail faster in mxs1929_filter_runtime

If the test fails, there's no point in continuing with the load generation
as it only serves to slow things down. In few cases the test caused
std::bad_alloc to be thrown which prematurely stopped the ctest run.
This commit is contained in:
Markus Mäkelä 2018-10-08 01:07:22 +03:00
parent 166e335e95
commit a9a20bf16b
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -126,12 +126,12 @@ void load(TestConnections& test)
};
auto worker = [&](std::atomic<bool>& running) {
while (running)
while (running && test.global_result == 0)
{
Connection c = test.maxscales->rwsplit();
c.connect();
while (running)
while (running && test.global_result == 0)
{
test.expect(c.query("select 1"), "Query should succeed: %s", c.error());
}
@ -152,12 +152,12 @@ void filter_swap(TestConnections& test)
};
auto worker = [&](std::atomic<bool>& running) {
while (running)
while (running && test.global_result == 0)
{
Connection c = test.maxscales->rwsplit();
c.connect();
while (running)
while (running && test.global_result == 0)
{
test.expect(c.check("select 1", "1"), "Query should not return 1 as a result");
}