Fix test failures
Added timeouts to maxinfo_sql and mysqlmon_failover_stress, fixed fwf_syntax to work with out-of-source test runs.
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <linux/limits.h>
|
||||
#include "testconnections.h"
|
||||
#include "fw_copy_rules.h"
|
||||
|
||||
@ -65,10 +66,12 @@ int main(int argc, char** argv)
|
||||
/** Create rule file with syntax error */
|
||||
truncate(temp_rules, 0);
|
||||
create_rule(rules_failure[i], users_ok[0]);
|
||||
copy_rules(&test, (char*)temp_rules, (char*)test_dir);
|
||||
char buf[PATH_MAX + 1];
|
||||
copy_rules(&test, (char*)temp_rules, (char*)getcwd(buf, sizeof(buf)));
|
||||
|
||||
test.tprintf("Testing rule: %s\n", rules_failure[i]);
|
||||
test.add_result(test.maxscales->start_maxscale(0) == 0, "MaxScale should fail to start");
|
||||
test.maxscales->stop_maxscale(0);
|
||||
|
||||
/** Check that MaxScale did not start and that the log contains
|
||||
* a message about the syntax error. */
|
||||
|
||||
@ -61,20 +61,27 @@ int main(int argc, char** argv)
|
||||
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
test.set_timeout(60);
|
||||
for (auto a : commands)
|
||||
{
|
||||
test.try_query(conn, "%s", a.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
test.stop_timeout();
|
||||
|
||||
mysql_close(conn);
|
||||
|
||||
run = false;
|
||||
|
||||
test.set_timeout(60);
|
||||
|
||||
for (auto& a : threads)
|
||||
{
|
||||
a.join();
|
||||
}
|
||||
|
||||
test.stop_timeout();
|
||||
|
||||
return test.global_result;
|
||||
}
|
||||
|
||||
@ -515,12 +515,14 @@ void run(TestConnections& test)
|
||||
|
||||
while (time(NULL) - start < TEST_DURATION)
|
||||
{
|
||||
test.set_timeout(20);
|
||||
test.maxscales->wait_for_monitor();
|
||||
|
||||
int master_id = get_master_server_id(test);
|
||||
|
||||
if (master_id > 0 && master_id <= 4)
|
||||
{
|
||||
test.set_timeout(20);
|
||||
cout << "\nStopping node: " << master_id << endl;
|
||||
test.repl->stop_node(master_id - 1);
|
||||
|
||||
@ -530,6 +532,7 @@ void run(TestConnections& test)
|
||||
test.maxscales->wait_for_monitor();
|
||||
list_servers(test);
|
||||
|
||||
test.set_timeout(20);
|
||||
test.maxscales->wait_for_monitor();
|
||||
cout << "\nStarting node: " << master_id << endl;
|
||||
test.repl->start_node(master_id - 1);
|
||||
|
||||
Reference in New Issue
Block a user