From a26f6eaf88bbdb762bdb883aca82b575dd2d0b22 Mon Sep 17 00:00:00 2001 From: mqrause <38702195+mqrause@users.noreply.github.com> Date: Sat, 5 Oct 2024 18:18:32 +0200 Subject: [PATCH] small patch to ranged balance test flakiness (#76824) Co-authored-by: mqrause --- tests/ranged_balance_test.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/ranged_balance_test.cpp b/tests/ranged_balance_test.cpp index b65e44e5d7504..b577d89593219 100644 --- a/tests/ranged_balance_test.cpp +++ b/tests/ranged_balance_test.cpp @@ -461,15 +461,16 @@ static void shoot_monster( const std::string &gun_type, const std::vectorfire_gun( monster_pos, 1, *shooter->get_wielded_item() ); damage.add( prev_HP - mon.get_hp() ); - if( damage.margin_of_error() < 0.05 && damage.n() > 100 ) { - break; - } if( other_checks ) { other_check_success += other_checks( *shooter, mon ); } + if( damage.margin_of_error() < 0.05 && damage.n() > 100 ) { + break; + } mon.die( nullptr ); } while( damage.n() < 200 ); // In fact, stable results can only be obtained when n reaches 10000 const double avg = damage.avg(); + CAPTURE( damage.n() ); CAPTURE( gun_type ); CAPTURE( mods ); CAPTURE( ammo_type );