feat: display per-test client log sections (hive TestLogOffsets)#76
Merged
Merged
Conversation
Hive can now reuse client containers across many tests (ethereum/hive#1402) and reports the byte range of the client log belonging to each test in clientInfo[].logOffsets. Surface those ranges in the UI: - types: TestLogOffsets, clientInfo[].logOffsets, multiTestContext, optional summaryResult fields - hide multi-test context pseudo-tests from the results table and stats - per-test Logs links anchor the viewer on the test's byte range - expanded rows show a client-log excerpt (Range request, capped at 128 KB) next to the existing test-details excerpt - LogViewer: ?begin&end now loads the full file, maps byte offsets to lines (byte-accurate), highlights the section and scrolls to it - byteRange utils defend against servers that ignore Range headers
When anchored on a test's byte range (?begin&end), fetch only the range plus 64 KB of context via HTTP Range requests instead of the whole file, so shared client logs of any size render instantly: - expand-up/expand-down buttons load more context in 64 KB steps, preserving the scroll position when prepending - absolute line numbers resolve in the background by streaming the window prefix and counting newlines (window-relative until then) - 'Load full file' escape hatch switches to the full view - servers without Range support fall back to the full view for free
Adds the inverse mapping of per-test log offsets — from a shared client log back to the tests it contains: - LogViewer sidebar listing every test section of the current log in log order, with pass/fail dots, a failures filter, and per-segment links to the test details; clicking a segment re-anchors the viewer - suite page 'Shared Client Sessions' panel summarising the client instances owned by multi-test context entries (tests served, log size, lifecycle status), replacing the hidden pseudo test case
tanstack-virtual smooth scrolling does not reliably complete over long distances on a freshly mounted virtualizer, leaving anchored views at the top of the window instead of on the highlighted section.
Counted directly when the server returned the whole file, otherwise by streaming the prefix in the background; skipped for excerpts starting beyond 8 MB so expanding a row never triggers huge downloads.
- share one isRealTestCase predicate (5 inline multiTestContext filters) and one logViewerUrl builder (3 inline route constructions) - move window chunk helpers (EOF detection, partial-line trims) into byteRange.ts, shared by initial load and both expand directions - replace per-request prefix streaming with checkpoint-cached, bounded line-number resolution (resolveLineNumber); navigating between tests in the same log now only streams the gap since the last count - drop the HEAD pre-flight (Content-Range already carries the size), LogViewer's duplicate byte formatter, derivable lineCount/truncated state, dead resets, and the stale-result ref machinery - VirtualizedLogContent takes prependedLines (its own units) instead of a pixel scroll adjustment; line-height knowledge stays internal - suite JSON query marked immutable (staleTime: Infinity); themed CSS variables replace hardcoded border/text colors in the new components
Production results record logOffsets with begin == end when a client produced no output during a test; requesting that range can even yield 416 at EOF. fetchByteRange now short-circuits empty ranges and expanded rows say so instead of rendering an empty excerpt. Scroll-to-index timeouts in the virtualized views are cleared on re-run so a pending scroll never fires against an outdated index, and sidebar rows guard against virtual items that momentarily outlive a shrinking filtered list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hive can reuse one client container across many tests (ethereum/hive#1402, currently used by
eels/consume-enginex); each test'sclientInfo[].logOffsetsthen gives the byte range of the shared client log belonging to that test. This PR surfaces those ranges — simulator-agnostic, keyed only off the presence oflogOffsets/multiTestContextin the suite JSON.Suite page
multiTestContextpseudo-test is hidden from the table and stats.Log viewer
Notes
begin == end, client produced no output) are handled explicitly.Local testing: My agent made this tarball (that includes results) so your agent should be able to run it locally, jlmk if you have any trouble!
hive-view_shared-client-logs-demo.mp4