From bab1dbc78ac8cd5fe67a3a456841a5c0bdd9f05b Mon Sep 17 00:00:00 2001 From: Yashwant Sahu Date: Thu, 19 Dec 2024 11:22:31 +0530 Subject: [PATCH] Added tests for MySQL with and without compression. --- test/tap/tests/mysql-protocol_compression_level-t.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tap/tests/mysql-protocol_compression_level-t.cpp b/test/tap/tests/mysql-protocol_compression_level-t.cpp index 5e364efb3..f295de712 100644 --- a/test/tap/tests/mysql-protocol_compression_level-t.cpp +++ b/test/tap/tests/mysql-protocol_compression_level-t.cpp @@ -82,7 +82,7 @@ int main(int argc, char** argv) { if(cl.getEnv()) return exit_status(); - plan(7); + plan(8); // ProxySQL connection without compression proxysql = initilize_mysql_connection(cl.host, cl.username, cl.password, cl.port, false); @@ -158,10 +158,10 @@ int main(int argc, char** argv) { goto cleanup; } - diff = time_mysql_without_compressed - time_mysql_compressed; + diff = abs(time_mysql_without_compressed - time_mysql_compressed); performance_diff = (diff * 100) / time_mysql_without_compressed; - diag("Time difference for mysql, compression and without compression is: %d", performance_diff); + ok((performance_diff < 10), "MySQL with compression performed well compared to without compression. Performance difference: %d percentage", performance_diff); ret = get_variable_value(proxysql_admin, "mysql-protocol_compression_level", compression_level, true); if (ret == EXIT_SUCCESS) {