Fix the smoke test's intermittent failure: a bot taking the wrong portal
The long-standing smoke flake -- failing now and then, always first in a pre-push hook whose logs were discarded -- finally failed with its logs kept. bot1, whose account picks the Proving Grounds, had gone into the Choir Vault, so "the proving grounds opened" never matched. The bot wandered a full-speed Lissajous for 90 of every 120 ticks in the hub, then walked toward its entrance for 30 holding interact the entire way. The three entrances sit in a row, so a wander that happened to end near the middle one sent the bot bound for the right-hand portal across the Choir Vault's ring with the key down, and in it went. Where the wander stopped depended on network timing, which is why it was intermittent and why it never reproduced on demand. The bot now walks straight to its own entrance and presses interact only while standing on that one. Six consecutive smoke runs pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
99f0d2a783
commit
3d1b5da72b
2 files changed
+31
-457
No files matched your search
@@ -274,12 +274,25 @@ func _bot_input() -> InputFrame:
|
||||
# Downed bots ask for the hub, same as a player would -- otherwise a bot
|
||||
# that dies mid-run just lies there and the smoke test stalls.
|
||||
return InputFrame.make(input_tick, Vector2.ZERO, aim, InputFrame.BTN_INTERACT)
|
||||
if instance_kind == Protocol.InstanceKind.LOBBY and _bot_tick % 120 < 30:
|
||||
buttons |= InputFrame.BTN_INTERACT
|
||||
# Walk onto a portal instead of orbiting, or interact never lands.
|
||||
# Which one is picked from the account id, so a smoke run with several
|
||||
# bots exercises every dungeon rather than only the first.
|
||||
move = (bot_portal() - predicted_pos).normalized()
|
||||
if instance_kind == Protocol.InstanceKind.LOBBY:
|
||||
# Straight to its own entrance, picked from the account id so a smoke
|
||||
# run with several bots exercises every dungeon -- and interact pressed
|
||||
# ONLY while standing on that one.
|
||||
#
|
||||
# It used to wander for 90 ticks in every 120 and then walk to its
|
||||
# portal holding interact the whole way. The three entrances sit in a
|
||||
# row, so a wander that ended near the middle one sent the bot bound for
|
||||
# the Proving Grounds straight across the Choir Vault's ring with the
|
||||
# key down, and in it went. Which dungeons opened depended on where a
|
||||
# timing-dependent wander happened to stop: this was the smoke test's
|
||||
# long-standing intermittent failure, and it only ever showed up as
|
||||
# "the proving grounds opened" (or another entrance) going missing.
|
||||
var target := bot_portal()
|
||||
move = (target - predicted_pos).normalized() \
|
||||
if predicted_pos.distance_to(target) > 6.0 else Vector2.ZERO
|
||||
var here := portal_here()
|
||||
if not here.is_empty() and (here["pos"] as Vector2).is_equal_approx(target):
|
||||
buttons |= InputFrame.BTN_INTERACT
|
||||
var slot := 0
|
||||
if instance_kind == Protocol.InstanceKind.DUNGEON:
|
||||
# Grab at whatever is underfoot and occasionally drink, so the item
|
||||
|
||||
Reference in new issue
Block a user