fix(test/tap): halve expected backend conn count in test_sqlite3_pass_exts-t on 9.x

Follow-up to cbbd10ba7 (skip native_password backend fixtures on MySQL 9.x).

The Phase-3 end-to-end loop runs RAND_USERS_GEN (100) iterations on 8.4
— 50 with mysql_native_password + 50 with caching_sha2_password — and
each successful login creates one backend connection. On 9.x the native
half is skipped, so only 50 actual connections are made.

The post-loop assertion "Number of backend conns created should match
conn attempts" was hardcoded to compare against RAND_USERS_GEN. When
native was skipped, actual=50 but expected=100, producing:

  not ok 2113 - Number of backend conns created should match conn
                attempts   exp:'100', act:'50'

Fix: compute expected_conns based on g_mysql_supports_native_password
(the same flag that gates the Phase-3 loop range) and use it both for
the wait_for_cond() condition string and the assertion.

Verified on a live mysql90 backend: test now reports
  ok 2113 - ... exp:'50', act:'50'
and exits 0 (2113/2113 assertions pass in 3.4s).
v3.0-dbdeployer-mysql84-gr
Rene Cannao 1 month ago
parent cbbd10ba74
commit d5b796cdea

@ -676,12 +676,19 @@ int main(int argc, char** argv) {
mysql_close(proxy);
}
// Only the iterations we actually ran produce backend connections.
// When the native_password half is skipped (MySQL 9.x), expected
// count is halved.
const uint32_t expected_conns =
g_mysql_supports_native_password ? RAND_USERS_GEN : (RAND_USERS_GEN / 2);
const string EXPECTED_CONNS_S { std::to_string(expected_conns) };
const string SEL_POOL_CONNS {
"SELECT SUM(ConnUsed + ConnFree) FROM stats.stats_mysql_connection_pool"
" WHERE hostgroup=" + TAP_MYSQL8_BACKEND_HG_S
};
const string COND_CONN_CREATION {
"SELECT IIF((" + SEL_POOL_CONNS + ")=" + RAND_USERS_GEN_S + ", 'TRUE', 'FALSE')"
"SELECT IIF((" + SEL_POOL_CONNS + ")=" + EXPECTED_CONNS_S + ", 'TRUE', 'FALSE')"
};
wait_for_cond(admin, COND_CONN_CREATION, 10);
@ -693,9 +700,9 @@ int main(int argc, char** argv) {
}
ok(
RAND_USERS_GEN == cur_conns.val,
expected_conns == cur_conns.val,
"Number of backend conns created should match conn attempts exp:'%u', act:'%lu'",
RAND_USERS_GEN, cur_conns.val
expected_conns, cur_conns.val
);
}

Loading…
Cancel
Save