test_friends: --hold for the guest role, report chunks once they arrive

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-15 00:03:06 +02:00
parent c7f30d2105
commit 341aa98a96
+4 -2
View File
@@ -259,13 +259,14 @@ def one_side(args, work):
print(f'host: {game("friends status")}')
else:
join(game, args.code, 'Remote')
v = game.wait('status', lambda v: v['server']['joined'] and v['player'] is not None, 60, 'joined')
game.wait('status', lambda v: v['server']['joined'] and v['player'] is not None, 60, 'joined')
game('chat hello across machines')
game.wait('status', lambda v: v['server']['chunks'] > 0, 30, 'chunks')
v = game.wait('status', lambda v: v['server']['chunks'] > 0, 30, 'chunks')
print(f'guest joined: {v["server"]["address"]}, {v["server"]["chunks"]} chunks')
game('key w down')
time.sleep(1.0)
game('key w up')
time.sleep(args.hold)
game('disconnect')
finally:
game.stop()
@@ -281,6 +282,7 @@ def main():
parser.add_argument('--code')
parser.add_argument('--path', choices=['relay', 'direct'])
parser.add_argument('--wait', type=float, default=600)
parser.add_argument('--hold', type=float, default=0, help='guest: stay this many seconds before leaving')
parser.add_argument('--baseline', action='store_true', help='first run the same checks over plain LAN')
args = parser.parse_args()
args.client, args.resources = args.client.resolve(), args.resources.resolve()