Skip to content

Commit

Permalink
small patch to ranged balance test flakiness (#76824)
Browse files Browse the repository at this point in the history
Co-authored-by: mqrause <[email protected]>
  • Loading branch information
mqrause and mqrause authored Oct 5, 2024
1 parent 65aca7f commit a26f6ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/ranged_balance_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,16 @@ static void shoot_monster( const std::string &gun_type, const std::vector<std::s
const int prev_HP = mon.get_hp();
shooter->fire_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 );
Expand Down

0 comments on commit a26f6ea

Please sign in to comment.