From 0a897aa83917e03b8f3964125b0eb1da5f5a1c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 5 Nov 2019 12:52:26 +0200 Subject: [PATCH] Fix ccrfilter_global Made sure that the inserted row is replicated before inserting another one. Shortened the test so that slower systems finish it within a reasonable time. Increased the time that the writes are routed to the master. --- maxscale-system-test/ccrfilter_global.cpp | 5 ++++- .../cnf/maxscale.cnf.template.ccrfilter_global | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/maxscale-system-test/ccrfilter_global.cpp b/maxscale-system-test/ccrfilter_global.cpp index 709c19a98..943c6796a 100644 --- a/maxscale-system-test/ccrfilter_global.cpp +++ b/maxscale-system-test/ccrfilter_global.cpp @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) auto secondary = test.maxscales->rwsplit(); secondary.connect(); - for (int i = 0; i < 50; i++) + for (int i = 0; i < 25; i++) { conn.connect(); test.expect(conn.query("INSERT INTO test.t1 VALUES ('" + data + "')"), @@ -34,6 +34,9 @@ int main(int argc, char* argv[]) // Existing connections should also see the inserted rows auto second_count = std::stoi(secondary.field("SELECT COUNT(*) FROM test.t1")); test.expect(second_count == i + 1, "Missing `%d` rows from open connection.", (i + 1) - count); + + // Make sure the row is replicated before inserting another one + test.repl->sync_slaves(); } conn.connect(); diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.ccrfilter_global b/maxscale-system-test/cnf/maxscale.cnf.template.ccrfilter_global index c360e6b35..817196657 100644 --- a/maxscale-system-test/cnf/maxscale.cnf.template.ccrfilter_global +++ b/maxscale-system-test/cnf/maxscale.cnf.template.ccrfilter_global @@ -17,7 +17,7 @@ monitor_interval=1000 [ccrfilter] type=filter module=ccrfilter -time=5 +time=10 global=true # RWSplit