From 0cfda3fa18ba7549abfdda375cf34a3f60e5529a Mon Sep 17 00:00:00 2001 From: PJ Date: Sun, 16 Aug 2026 01:46:11 +0530 Subject: [PATCH] fix(runner): report a log fetch the driver could not make The comment claimed the failure was warned about; nothing warned, so a device whose log fetch failed every step held noLogcatErrors on evidence nobody collected. Claude-Session: https://claude.ai/code/session_01ShuAy8q8ZfPi8KHxwc8JpQ --- internal/runner/runner.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/internal/runner/runner.go b/internal/runner/runner.go index 5496da9..d89b8cf 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -163,7 +163,7 @@ func Run(ctx context.Context, options Options) (Summary, error) { }) logSince := lastLogTime g.Go(func() error { - logs = collectLogs(gctx, options.Driver, logSince) + logs = collectLogs(gctx, options.Driver, logger, si, logSince) return nil }) // All goroutines write to local variables and return nil, so the Wait @@ -824,11 +824,23 @@ func applyAction(ctx context.Context, drv driver.DeviceDriver, action verifier.A } // collectLogs pulls recent error-level log entries from the driver since the -// previous fetch. A failure is warned-on but not fatal: log capture is a -// best-effort observability channel, not a correctness dependency. -func collectLogs(ctx context.Context, drv driver.DeviceDriver, since time.Time) []verifier.LogEntry { +// previous fetch. A failure is warned-on but not fatal: one unreadable fetch on +// a flaky device should not end a run. It is not free either. This fetch is the +// whole evidence base for state.logs, so a step that could not make it leaves +// every log property (the default noLogcatErrors included) holding on an empty +// slice, and that has to be visible in the run's output rather than read as the +// app having logged nothing. +func collectLogs( + ctx context.Context, + drv driver.DeviceDriver, + logger *slog.Logger, + step int, + since time.Time, +) []verifier.LogEntry { entries, err := drv.RecentLogs(ctx, since, "E") if err != nil { + logger.Warn("log fetch failed; log properties hold vacuously this step", + "step", step, "err", err) return nil } result := make([]verifier.LogEntry, 0, len(entries))