Fixed TAP test

pull/4875/head
Rahim Kanji 1 year ago
parent c5e348628d
commit 45eadce110

@ -147,7 +147,10 @@ void copy_stdin_test(PGconn* conn, const std::string& set_val, std::fstream& f_p
return;
}
usleep(1000); // Wait for the query to be sent
PQconsumeInput(conn);
while (PQisBusy(conn)) {
PQconsumeInput(conn);
}
ok(check_logs_for_command(f_proxysql_log, ".*\\[INFO\\].* Switching to Fast Forward mode \\(Session Type:0x06\\)"), "Session Switched to fast forward mode");
@ -213,7 +216,7 @@ void execute_test(bool with_ssl, bool diff_conn, std::fstream& f_proxysql_log) {
for (int i = 0; i < MAX_ITERATION; i++) {
if (!setupTestTable(backend_conn.get()))
return;
usleep(1000);
const std::string& value = setIntervalStyle(backend_conn.get(), i, f_proxysql_log);
if (value.empty())
@ -237,7 +240,7 @@ void execute_test(bool with_ssl, bool diff_conn, std::fstream& f_proxysql_log) {
if (!setupTestTable(backend_conn.get()))
return;
usleep(1000);
const std::string& value = setIntervalStyle(backend_conn.get(), i, f_proxysql_log);
if (value.empty())

@ -654,7 +654,10 @@ void testSTDIN_MULTISTATEMENT(PGconn* admin_conn, PGconn* conn, std::fstream& f_
return;
}
usleep(1000); // Wait for the query to be sent
PQconsumeInput(conn);
while (PQisBusy(conn)) {
PQconsumeInput(conn);
}
ok(check_logs_for_command(f_proxysql_log, ".*\\[INFO\\].* Switching to Fast Forward mode \\(Session Type:0x06\\)"), "Session Switched to fast forward mode");

@ -362,7 +362,14 @@ void testMultistatementWithCopy(PGconn* admin_conn, PGconn* conn) {
if (PQsendQuery(conn, "SELECT * FROM copy_test; COPY copy_test TO STDOUT") == 0) {
fprintf(stderr, "Error sending query: %s", PQerrorMessage(conn));
PQfinish(conn);
return;
}
PQconsumeInput(conn);
while (PQisBusy(conn)) {
PQconsumeInput(conn);
}
// Check first result (SELECT statement)
PGresult* res = PQgetResult(conn);
if (PQresultStatus(res) != PGRES_TUPLES_OK) {

Loading…
Cancel
Save