Skip to content

Commit

Permalink
Follow up for CONC-622 test:
Browse files Browse the repository at this point in the history
Host 0.0.0.0 is mapped to locahost, so we need another invalid
host address (1.0.0.0) instead and reduce the number of loops.
  • Loading branch information
9EOR9 committed Jan 15, 2023
1 parent 5f61336 commit 003b5cd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions unittest/libmariadb/async.c
Expand Up @@ -255,11 +255,12 @@ static int test_conc622(MYSQL *my __attribute__((unused)))
int status;
uint default_timeout;
int i;
const char *invalid_host= "1.0.0.0";

if (skip_async)
return SKIP;

for (i=0; i < 100; i++)
for (i=0; i < 5; i++)
{
mysql_init(&mysql);
rc= mysql_options(&mysql, MYSQL_OPT_NONBLOCK, 0);
Expand All @@ -273,7 +274,7 @@ static int test_conc622(MYSQL *my __attribute__((unused)))
mysql_options(&mysql, MYSQL_READ_DEFAULT_GROUP, "myapp");

/* Returns 0 when done, else flag for what to wait for when need to block. */
status= mysql_real_connect_start(&ret, &mysql, "0.0.0.0", username, password, schema, port, socketname, 0);
status= mysql_real_connect_start(&ret, &mysql, invalid_host, username, password, schema, port, socketname, 0);
while (status)
{
status= wait_for_mysql(&mysql, status);
Expand All @@ -288,7 +289,8 @@ static int test_conc622(MYSQL *my __attribute__((unused)))
status= mysql_close_cont(&mysql, status);
}
} else {
diag("Expected error when connection to host '0.0.0.0'");
diag("Expected error when connecting to host '%s'", invalid_host);
diag("Connected to %s", mysql_get_server_info(&mysql));
return FAIL;
}
}
Expand Down

0 comments on commit 003b5cd

Please sign in to comment.