mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Fixes Flakey Ashwalker Lung Unit Test Failures on gateway_test (#94821)
## About The Pull Request
Closes #94794
Both of these unit tests were using the outdated way of changing the gas
mix on a turf, probably because they were more than a few years old
apiece. The modern way is using the `/datum/gas_mixture` and
`parse_gas_string()` to either retrieve the gas mix from cache or
generate it on-demand. Neither of these tests were doing that, and they
worked well enough until they got mutated in #94771
(01c7ef7de1).
I am uncertain of the specifics that are behind either one
spontaneously/always failing but I do know that they weren't doing it
the "right way". I suspect the flakiness in the Breath Ashwalker Sanity
(that loads a full ashwalker carbon instead of just the lungs) is
because it was initiating a gas mix with no volume within it, and that
volume would get filled up as the other turfs in the loc would update it
somewhere in the atmos chain? We only checked for the "low oxygen"
status effect on the mob and that could easily have been filled up to
normal depending on how much happened. Regardless the best way to fix
this is to just have all the turfs in the unit test room get changed to
prevent any schenanigans with that.
Another explanation for the flakiness is that the ashwalker lungs
themselves use the same "old" way of getting the gas mix instead of the
modern way (such that the lung breath values can adapt to changes)... I
think...
## Why It's Good For The Game
Less developer frustration at spontaneously failing unit tests through
no fault of their own.
## Changelog
Irrelevant
This commit is contained in:
@@ -998,13 +998,13 @@
|
||||
#define GAS_TOLERANCE 5
|
||||
|
||||
/obj/item/organ/lungs/lavaland/Initialize(mapload)
|
||||
var/datum/gas_mixture/immutable/planetary/mix = SSair.planetary[LAVALAND_DEFAULT_ATMOS]
|
||||
var/datum/gas_mixture/volumed_mix = new(BREATH_VOLUME * 1000) // to be safe
|
||||
var/datum/gas_mixture/immutable/planetary/mix = SSair.parse_gas_string(LAVALAND_DEFAULT_ATMOS, /datum/gas_mixture/immutable/planetary)
|
||||
|
||||
if(!mix?.total_moles()) // this typically means we didn't load lavaland, like if we're using the LOWMEMORYMODE define
|
||||
return ..()
|
||||
volumed_mix.copy_from(mix)
|
||||
|
||||
// Take a "breath" of the air
|
||||
var/datum/gas_mixture/breath = mix.remove(mix.total_moles() * BREATH_PERCENTAGE)
|
||||
var/datum/gas_mixture/breath = volumed_mix.remove(volumed_mix.total_moles() * BREATH_PERCENTAGE)
|
||||
|
||||
var/list/breath_gases = breath.gases
|
||||
|
||||
|
||||
Reference in New Issue
Block a user