From cd23894b80bbea06dc5f64240ac1014ba1ef5aac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 00:52:49 +0000 Subject: [PATCH 2/2] Gate DDL rollback test behind --run-ddl-tests flag to avoid table locks on production databases Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- zone/cli/tests/cli_zone_state.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/zone/cli/tests/cli_zone_state.cpp b/zone/cli/tests/cli_zone_state.cpp index 040cbd49e..fd8183e5a 100644 --- a/zone/cli/tests/cli_zone_state.cpp +++ b/zone/cli/tests/cli_zone_state.cpp @@ -936,8 +936,19 @@ inline void TestClientBuffPersistence() ); } -inline void TestClientBuffPersistenceRollback() +inline void TestClientBuffPersistenceRollback(bool run_ddl) { + // DDL on the live character_buffs table can lock it and disrupt running servers. + // Only run when the caller explicitly opts in via --run-ddl-tests. + if (!run_ddl) { + RunTest( + "Client Buff Persistence > Rollback: skipped (pass --run-ddl-tests to enable)", + true, + true + ); + return; + } + constexpr uint32 test_character_id = 99999992; constexpr uint16 preexisting_spell_id = 6824; // stable, widely-used spell present in all data sets constexpr int suppressed_tics = 99; @@ -1344,7 +1355,7 @@ void ZoneCLI::TestZoneState(int argc, char **argv, argh::parser &cmd, std::strin TestZoneVariables(); TestHpManaEnd(); TestClientBuffPersistence(); - TestClientBuffPersistenceRollback(); + TestClientBuffPersistenceRollback(cmd["--run-ddl-tests"]); TestBuffs(); TestLocationChange(); TestEntityVariables();