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

Ensure bleed test isn't failing due to clothing #79227

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

PatrikLundell
Copy link
Contributor

@PatrikLundell PatrikLundell commented Jan 18, 2025

Summary

None

Purpose of change

Fix #79214, i.e. bleed test failing occasionally.

Describe the solution

Ensure the cutting victim is stripped before the test to ensure clothing won't block the damage.

Describe alternatives you've considered

Should test NPCs be subjected to more control to reduce the risk of tests failing due to normal variability and changes to them due to game considerations that do not (and really should not have to) take test setups into consideration?

Testing

Hacked the test to try to cut the victim 1 million times, healing in between, and count how many times the victim took damage. Ran the hacked test a number of times, and no failures to cut were seen.

Changed the hack to create the victim 100 times, cutting it, and checking how many times cutting succeeded/failed. This turned out to be 1-2 times over 2-3 tests.

Changed the hack to strip the victim before the test. No failures to inflict damage over 3 runs.

Reverted the code to the original and introduced stripping of the victim both in the PC attack and the NPC vs NPC tests. The latter just in case, as future clothing changes may occasionally provide too much protection (and it may happen currently but hasn't been happening frequently enough to be investigated).

Additional context

@github-actions github-actions bot added Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 18, 2025
@Maleclypse Maleclypse merged commit 87e7cfd into CleverRaven:master Jan 18, 2025
29 checks passed
@PatrikLundell PatrikLundell deleted the bleed_test branch January 18, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <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. json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bleeding test keeps failing
2 participants