mirror of https://github.com/sysown/proxysql
Two recent "cleanup" commits on this branch silently changed test behavior and caused the tests to fail under myrun2. 1) kill_connection2-t.cpp (regressed inlint-tap-tests-static-analysis3f0cd6a0c): The "cleanup - replace NULL with nullptr, convert loops to range-based" commit flipped one assertion from ok(rc == 0, ...) to ok(rc != 0, ...) on the first DO 1 batch after a 12s sleep. With mysql-max_transaction_time=17000 (17s), the connection is still alive at 12s by design — ProxySQL only kills it at ~18s. The original test correctly expected rc == 0 there; the second DO 1 batch (after +12s = 24s total) continues to correctly expect rc != 0. 2) max_connections_ff-t.cpp (regressed inda655099e): The "static analysis narrowing conversions" commit introduced an integer overflow by wrapping a chrono::nanoseconds count in static_cast<int>(). For the 8000ms test the elapsed time is ~8e9 ns, which overflows int32 (max ~2.147e9) and wraps negative, producing "Waited: -0.589502" and a failed assertion. The 2000ms test happened to fit under 2.147e9 ns and kept passing, hiding the bug. Use static_cast<double> for the nanoseconds count, and drop the unnecessary int casts on connect_timeout / poll_timeout — those are already long, so long / 1000.0 is a valid double.
parent
3babaada88
commit
13a43e2ffe
Loading…
Reference in new issue