At /tg/, our automated code testing and review system will occasionally fail to complete with errors relating to a failed in check.
The code looks something like this:
/datum/asset/spritesheet/vending/register()
for (var/k in GLOB.vending_products)
var/atom/item = k
if (!ispath(item, /atom))
continue
var/icon_file = initial(item.icon)
var/icon_state = initial(item.icon_state)
var/icon/I
var/icon_states_list = icon_states(icon_file)
if(icon_state in icon_states_list) // <----- this fails
I = icon(icon_file, icon_state, SOUTH)
var/c = initial(item.color)
if (!isnull(c) && c != "#FFFFFF")
I.Blend(c, ICON_MULTIPLY)
else
//this debugging info indicates it should have passed.
stack_trace("[item] does not have a valid icon state, icon=[icon_file], icon_state=[json_encode(icon_state)], icon_states=[json_encode(icon_states_list)]")
I = icon('icons/turf/floors.dmi', "", SOUTH)
//snip
(This code generates browser resources for items in vending machines, its ran during automated code testing as part of a check to ensure everything initializes without generating runtime errors.)
It will randomly error out, failing the first if but print debugging info that indicates the first if should have passed:
/obj/item/lightreplacer does not have a valid icon state, icon=icons/obj/janitor.dmi, icon_state="lightreplacer0", icon_states={
"caution":null,
"cleaner":null,
"sprayer_large":null,
"bucket":null,
"mop":null,
"mopbucket":null,
"mopbucket_water":null,
"cone":null,
"lightreplacer1":null,
"lightreplacer0":null, <----- here it is!
"4no_raisins":null,
"candy":null,
"chips":null,
"popcorn":null,
"cheesie_honkers":null,
"sosjerky":null,
"syndi_cakes":null,
"waffles":null,
"plate":null,
"pistachios_pack":null,
"semki_pack":null,
"tray":null,
"trashbag":null,
"trashbag1":null,
"trashbag2":null,
"trashbag3":null,
"cart":null,
"cart_water":null,
"cart_garbage":null,
"cart_mop":null,
"cart_spray":null,
"cart_sign1":null,
"cart_sign2":null,
"cart_sign3":null,
"cart_sign4":null,
"cart_replacer":null,
"sodawater":null,
"tonic":null,
"cola":null,
"purple_can":null,
"ice_tea_can":null,
"energy_drink":null,
"thirteen_loko":null,
"space_mountain_wind":null,
"dr_gibb":null,
"starkist":null,
"space-up":null,
"lemon-lime":null,
"shamblers":null,
"air":null,
"laughter":null,
"mister":null,
"waterbackpack":null,
"advmop":null,
"bluetrashbag":null,
"bluetrashbag1":null,
"bluetrashbag2":null,
"bluetrashbag3":null,
"smmop":null,
"adv_smmop":null,
"rainbowbpack":null,
"rainbowmister":null,
"energybar":null,
"woodbucket":null
}
Here is a failed travis build log from 2 days ago: https://travis-ci.org/tgstation/tgstation/jobs/576051728
Here is the code as it was during that failed check: https://github.com/tgstation/tgstation/blob/ bda590ec9f953f481f163d08404e3046495afb62/code/modules/ client/asset_cache.dm#L686-L694
It happens maybe 1% of the time, and has been going on since at least July 2nd when a report was made on github about it. It always triggers on the same atom (the light replacer)
Potential string tree fuckary with icon_states()? General failure of in?