Conversation
Contributor
Screenshot ChangesBase: Changed (12) |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds trace-oriented diagnostic logging to the virtual scheduling test infrastructure and wires it into inline completions tests to emit a swimlane-style execution trace when enabled.
Changes:
- Added a lightweight trace-aware logger (
ITraceLogger) for tests and exported it from the virtual scheduling test utilities. - Extended
runWithFakedTimersto optionally record timer history in both virtual-time and real-time modes and surface it via anonHistorycallback. - Enhanced execution history rendering to include caller stack frame details and continuation lines, and enabled opt-in time-trace output from inline completions tests.
Show a summary per file
| File | Description |
|---|---|
| src/vs/editor/contrib/inlineCompletions/test/browser/utils.ts | Adds optional time-trace logging, trace logger plumbing, and extra log calls in test contexts. |
| src/vs/editor/contrib/inlineCompletions/test/browser/inlineCompletions.test.ts | Enables time-trace output for one test and adds logger.logRun(...) markers around model actions. |
| src/vs/base/test/common/virtualScheduling/virtualTimeApi.ts | Increases captured stack depth for diagnostics and tweaks virtual timer scheduling behavior. |
| src/vs/base/test/common/virtualScheduling/traceLogger.ts | Introduces a trace-capturing logger for weaving log lines into execution graphs. |
| src/vs/base/test/common/virtualScheduling/runWithFakedTimers.ts | Adds onHistory support and installs a recording real-time TimeApi when not using fake timers. |
| src/vs/base/test/common/virtualScheduling/recordingTimeApi.ts | Implements a recording wrapper around the host time API to capture executed timer events with traces. |
| src/vs/base/test/common/virtualScheduling/index.ts | Re-exports the new recording API and trace logger utilities. |
| src/vs/base/test/common/executionGraph.ts | Improves caller-frame extraction and renders multi-frame details as continuation lines in swimlanes. |
Copilot's findings
- Files reviewed: 8/8 changed files
- Comments generated: 3
| return clock.schedule({ | ||
| time: clock.now + timeout, | ||
| run: () => { handler(); }, | ||
| run: handler, |
Comment on lines
+11
to
+17
| // V8 default `Error.stackTraceLimit` of 10 swallows everything past the | ||
| // first async boundary in the stacks we capture for trace diagnostics. | ||
| // Bump it so swimlane callers actually see the user code that scheduled a | ||
| // timer rather than just the Promise wrapper. | ||
| if (typeof Error.stackTraceLimit === 'number' && Error.stackTraceLimit < 50) { | ||
| Error.stackTraceLimit = 50; | ||
| } |
Comment on lines
+260
to
+262
| const out: string = history.length === 0 && logs.length === 0 | ||
| ? `[time trace ${mode}] (no events)` | ||
| : `[time trace ${mode}] ${history.length} events, ${logs.length} log lines\n${renderSwimlanes(buildHistoryFromTasks(history, history[0]?.time ?? 0, logs))}`; |
roblourens
previously approved these changes
May 5, 2026
Yoyokrazy
approved these changes
May 5, 2026
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.
No description provided.