From e7f739e95df49f8bd6ee8ff2eb812255803f064e Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Mon, 4 Mar 2019 18:16:56 +0200 Subject: [PATCH] MXS-2337 Fix sharding test There is now enought time between queries that the shard map is reconstructed. --- maxscale-system-test/cnf/maxscale.cnf.template.sharding | 1 + maxscale-system-test/sharding.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.sharding b/maxscale-system-test/cnf/maxscale.cnf.template.sharding index 9d8a99454..c21d3634b 100755 --- a/maxscale-system-test/cnf/maxscale.cnf.template.sharding +++ b/maxscale-system-test/cnf/maxscale.cnf.template.sharding @@ -17,6 +17,7 @@ user=maxskysql password=skysql auth_all_servers=1 ignore_databases_regex=.* +refresh_interval=5 [Sharding Listener] type=listener diff --git a/maxscale-system-test/sharding.cpp b/maxscale-system-test/sharding.cpp index c16c7eb11..19191f622 100644 --- a/maxscale-system-test/sharding.cpp +++ b/maxscale-system-test/sharding.cpp @@ -75,11 +75,11 @@ int main(int argc, char* argv[]) "GRANT SELECT,USAGE,CREATE ON shard_db.* TO 'user%d'@'%%'", i), "Query should succeed."); + execute_query(Test->repl->nodes[i], "FLUSH PRIVILEGES"); } Test->repl->close_connections(); Test->stop_timeout(); - sleep(10); MYSQL* conn; for (i = 0; i < Test->repl->N; i++) @@ -97,6 +97,7 @@ int main(int argc, char* argv[]) Test->add_result(execute_query(conn, "CREATE TABLE table%d (x1 int, fl int);", i), "Query should succeed."); } + sleep(6); // The router is configured to refresh the shard map if older than 5 seconds. for (i = 0; i < Test->repl->N; i++) {