Ensure bleed test isn't failing due to clothing #79227
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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