Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-flake the vehicle turret test #51249

Merged
merged 3 commits into from
Sep 1, 2021

Conversation

eltank
Copy link
Contributor

@eltank eltank commented Aug 31, 2021

Summary

Bugfixes "De-flake the vehicle turret test"

Purpose of change

The vehicle turret test occasionally fails because a turret randomly misfires.
This seems to happen with 0.5% probability if the default ammo of the turret is RECYCLED (which is a separate bug but I'll fix it here anyway).

Describe the solution

Add 2 more attempts to fire. The test will pass if at least one bullet is fired.
Also fix the RNG seed to make the test deterministic, hence less annoying to debug. [@jbytheway talked me out of it, saying the seed is printed by failing tests]
Changed default ammo for improvised railguns to steel rail, which doesn't misfire (unlike rebar rail).
Added a warning message when the default turret ammo is RECYCLED, this is silent now but will warn if someone adds a turret with bad default ammo in the future.

Describe alternatives you've considered

Testing

Ran the test.

Additional context

The only turrets that fire recycled ammo (and can misfire) are the 2 obsolete improvised railguns.
Edit: Changed their default ammo to steel rail, so now no turrets can misfire when using default ammo.

@actual-nh actual-nh added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics Vehicles Vehicles, parts, mechanics & interactions labels Aug 31, 2021
@kevingranade kevingranade merged commit 49c9e88 into CleverRaven:master Sep 1, 2021
@eltank eltank deleted the deflake_turret_test branch September 1, 2021 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Items: Ammo / Guns Ammunition for all kinds of weapons and these weapons themselves Ranged Ranged (firearms, bows, crossbows, throwing), balance, tactics Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants