Skip to content

Commit

Permalink
more TAP test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mirostauder committed Oct 2, 2023
1 parent 0bbeef6 commit 797c4e4
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI-3p-mysql-connector-j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-basictests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
cache:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-cb_taptests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-maketest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-package-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-repltests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-selftests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
cache:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-shuntest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI-taptests-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
cache:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/CI-taptests-ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
cache:
uses: mirostauder/proxysql/.github/workflows/ci-builds.yml@GH-Actions
uses: sysown/proxysql/.github/workflows/ci-builds.yml@GH-Actions
secrets: inherit

run:
needs: [ "cache" ]
uses: mirostauder/proxysql/.github/workflows/ci-taptests-ssl.yml@GH-Actions
uses: sysown/proxysql/.github/workflows/ci-taptests-ssl.yml@GH-Actions
secrets: inherit

2 changes: 1 addition & 1 deletion .github/workflows/CI-taptests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: false
# cancel-in-progress: false

jobs:
cache:
Expand Down
9 changes: 5 additions & 4 deletions test/tap/tests/test_binlog_fast_forward-t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,18 @@ int setup_replication(int server_id, bool frontend_ssl, bool backend_ssl, std::v

std::vector<std::string> admin_queries = {};
admin_queries.push_back(std::string("SET mysql-have_ssl='") + std::string(frontend_ssl ? "true" : "false") + "'");
admin_queries.push_back(std::string("UPDATE mysql_users SET use_ssl=") + std::string(frontend_ssl ? "1" : "0") + " WHERE username = 'root'");
admin_queries.push_back("LOAD MYSQL VARIABLES TO RUNTIME");
admin_queries.push_back(std::string("UPDATE mysql_users SET use_ssl=") + std::string(frontend_ssl ? "1" : "0") + " WHERE username = 'root'");
admin_queries.push_back("LOAD MYSQL USERS TO RUNTIME");
admin_queries.push_back(std::string("UPDATE mysql_servers SET use_ssl=") + std::string(backend_ssl ? "1" : "0"));
admin_queries.push_back("LOAD MYSQL SERVERS TO RUNTIME");

sleep(3);

MYSQL * mysql = mysql_init(NULL);
diag("Connecting: cl.root_username='%s' frontend_ssl=%d", cl.root_username, frontend_ssl);
if (frontend_ssl || backend_ssl) {
if (frontend_ssl)
mysql_ssl_set(mysql, NULL, NULL, NULL, NULL, NULL);
diag(">>> 'mysql_ssl_set(mysql, NULL, NULL, NULL, NULL, NULL);' <<<");
}
if (!mysql_real_connect(mysql, cl.host, cl.root_username, cl.root_password, NULL, cl.root_port, NULL, 0)) {
fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error(mysql));
return exit_status();
Expand Down
19 changes: 19 additions & 0 deletions test/tap/tests/test_binlog_reader_uses_previous_hostgroup-t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ const char* QUERY_CONN_CLOSED {
"SELECT ConnOk - ConnFree FROM stats.stats_mysql_connection_pool WHERE hostgroup=%d"
};


void * work(void *arg) {
sleep(30);
diag("Timeout! - exiting...");
exit(EXIT_FAILURE);
return NULL;
}

int run_funct_timeout(void *(*start_routine)(void *), int timeout) {
// we run the test on a separate thread because we have a built-in timeout
pthread_t thread_id;
if (pthread_create(&thread_id, NULL, start_routine, NULL)) {
fprintf(stderr, "Error calling pthread_create()");
return EXIT_FAILURE;
}
return 0;
}

int conn_pool_hg_stat_conn_closed(MYSQL* proxy_admin, int hg_id, vector<string>& out_stats) {
MYSQL_RES* my_stats_res = NULL;

Expand Down Expand Up @@ -77,6 +95,7 @@ int main(int argc, char** argv) {
}

plan(2 + 1);
run_funct_timeout(work, 30);

const int destination_hostgroup = 2;
string query;
Expand Down

0 comments on commit 797c4e4

Please sign in to comment.