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:
35
maxscale-system-test/mxs2563_concurrent_slave_failure.cpp
Normal file
35
maxscale-system-test/mxs2563_concurrent_slave_failure.cpp
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user