From 04c0171bcc2688db9515594ccf35f933b8def68a Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 30 Sep 2026 16:11:41 +0200 Subject: [PATCH] eve-browser-network: the headless deadline starts at its command The headless C# client armed a 45 s deadline as soon as its lease was up, but the orchestrator then runs the whole browser scenario (Chromium launch, two clicks, provider and Odin replacement, page reconnect) before it sends INVOKE. On ubuntu runners that scenario alone takes most of the budget: the last green run finished with little to spare, and since 2dc7c122 the ubuntu onboarding job has timed out in the headless process either before the receipt or during the post-receipt benchmark. The orchestrator already bounds each step it waits on, and closing stdin ends the headless wait for its command. The headless process now bounds only its own work: the 45 s deadline covers the invoke, convergence and benchmark after INVOKE arrives. Co-Authored-By: Claude Opus 5.5 --- samples/eve-browser-network/Program.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/eve-browser-network/Program.cs b/samples/eve-browser-network/Program.cs index c26d654b..a8cc3429 100644 --- a/samples/eve-browser-network/Program.cs +++ b/samples/eve-browser-network/Program.cs @@ -244,11 +244,13 @@ static async Task RunHeadlessAsync(Args arguments) Console.WriteLine("HEADLESS_READY " + JsonSerializer.Serialize(new { count = initial.Count })); } if (initial.Count >= arguments.ExpectedCount) completion.TrySetResult(); + var commandReceived = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var commandTask = Task.Run(async () => { var line = await Console.In.ReadLineAsync(); if (line == null || !line.StartsWith("INVOKE ", StringComparison.Ordinal)) throw new InvalidOperationException("The headless sample expected 'INVOKE ' on stdin."); + commandReceived.TrySetResult(); var commandId = line["INVOKE ".Length..].Trim(); var result = await mesh.InvokeAsync( target, @@ -268,6 +270,9 @@ static async Task RunHeadlessAsync(Args arguments) Console.WriteLine("HEADLESS_NETWORK_BENCHMARK " + JsonSerializer.Serialize( await MeasureOperationSessionAsync(mesh, target, arguments))); }); + // How long the caller takes to send the command is the caller's to bound + // (closing stdin ends the wait); this process bounds only its own work. + await Task.WhenAny(commandReceived.Task, commandTask); await Task.WhenAll(completion.Task, commandTask).WaitAsync(TimeSpan.FromSeconds(45)); }