MXS-2563: Add test case

Added a test case that reproduces the debug assertion with the old code
and verifies that it is fixed with the new one.
This commit is contained in:
Markus Mäkelä
2019-06-14 14:11:20 +03:00
parent f6a5b59067
commit 002281599e
3 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,35 @@
/**
* MXS-2563: Failing debug assertion at rwsplitsession.cc:1129 : m_expected_responses == 0
* https://jira.mariadb.org/browse/MXS-2563
*/
#include "testconnections.h"
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
test.maxctrl("alter monitor MariaDB-Monitor monitor_interval 99999");
auto conn = test.maxscales->rwsplit();
conn.connect();
conn.query("SET @a = (SELECT SLEEP(1))");
std::thread thr(
[&test]() {
sleep(5);
test.repl->stop_node(2);
test.repl->stop_node(3);
sleep(5);
test.repl->start_node(2);
test.repl->start_node(3);
});
// Should go to server2
conn.query("SELECT SLEEP(20)");
thr.join();
test.maxctrl("alter monitor MariaDB-Monitor monitor_interval 1000");
return test.global_result;
}