Repository navigation
Bound Cloud refreshes and prevent local terminal fallback #12636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
03a5b31
test: reproduce overlapping Cloud list and stats HTTP reads
austinywang 807b1b8
fix: own and bound Cloud read refreshes across callers
austinywang 8b6aee8
test(web): complete CodeRouter authentication module mocks
austinywang cafb8b0
ci: recognize the existing mapped Dock resize gate
austinywang 08c05cd
test: drive delayed panel polling with an injected clock
austinywang e73fc7e
fix: queue replacement reads and expire stale admission
austinywang 035c0dc
test(irx): join the retired watcher before checking redial state
austinywang d9a4ff6
fix: share network admission with team usage reads
austinywang 87860c8
fix: retain oversized Retry-After without duration overflow
austinywang 1944015
test: reproduce cross-waiter Cloud deadline cancellation
austinywang 919c11a
fix: preserve each Cloud reader deadline and remove fixture sleeps
austinywang 2552c38
fix: restore renderer fixture callbacks and clear Swift warnings
austinywang 6750cec
fix: keep Cloud integration within file budgets and compile C callbac…
austinywang acebfb2
test: present the initial frame before reclaiming the renderer
austinywang 2ff5c14
docs: cover the private SCP socket in the Cloud CLI skill
austinywang eb57883
test: reproduce local PTY escape from pending Cloud shortcuts
austinywang 96a8624
fix: retain Cloud execution ownership through pending terminal creation
austinywang f996f1a
fix: keep empty Cloud pane replacements on their machine
austinywang 30f0fc0
test: pass split insertion policy in cloud routing regression
austinywang cfcdc5b
fix: remove stale deleted Cloud VPN source from project wiring
austinywang 574833f
fix: recover cloud terminal rendering after reconnect
austinywang 66a1383
style: keep reconnect recovery readable
austinywang 3373222
fix: unblock synced CI test targets
austinywang 734bdcd
fix: wire Cloud refresh coalescing tests
lawrencecchen 7a4627a
docs: retain Cloud transfer failure socket coverage
lawrencecchen d873d53
style: remove trailing blank lines from Cloud models
lawrencecchen ec3f5bb
Merge origin/main into issue-12625-cloud-refresh-pressure
lawrencecchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
41 changes: 41 additions & 0 deletions
41
...es/macOS/CmuxTerminal/Tests/CmuxTerminalTests/TerminalSurface+RendererTestCallbacks.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import GhosttyKit | ||
| import GhosttyRuntimeTestStubs | ||
| import Testing | ||
| @testable import CmuxTerminal | ||
|
|
||
| extension TerminalSurface { | ||
| /// Synthetic runtimes still use the native token/callback handshake. The | ||
| /// fixture owns the surface until releaseSurfaceForTesting clears callbacks. | ||
| @MainActor | ||
| func installRendererTestCallbacks(_ runtime: UnsafeMutableRawPointer) { | ||
| let userdata = Unmanaged.passUnretained(self).toOpaque() | ||
| let presented = ghostty_surface_set_render_presented_callback(runtime, { userdata, token in | ||
| guard let userdata else { return } | ||
| MainActor.assumeIsolated { | ||
| Unmanaged<TerminalSurface>.fromOpaque(userdata).takeUnretainedValue().rendererFrameDidPresent(token: token) | ||
| } | ||
| }, userdata) | ||
| #expect(presented) | ||
| let failed = ghostty_surface_set_render_failed_callback(runtime, { userdata, token, status in | ||
| guard let userdata else { return } | ||
| MainActor.assumeIsolated { | ||
| Unmanaged<TerminalSurface>.fromOpaque(userdata).takeUnretainedValue().rendererFrameDidFail( | ||
| token: token, status: status | ||
| ) | ||
| } | ||
| }, userdata) | ||
| #expect(failed) | ||
| } | ||
|
|
||
| @MainActor | ||
| func acknowledgeRendererTestPresentation() { | ||
| guard rendererPresentationState.inFlightToken != nil, let surface else { return } | ||
| #expect(cmux_test_ghostty_renderer_present(surface)) | ||
| } | ||
|
|
||
| @MainActor | ||
| func failRendererTestPresentation() { | ||
| guard let surface else { Issue.record("expected a runtime surface"); return } | ||
| #expect(cmux_test_ghostty_renderer_fail(surface, Int32(GHOSTTY_RENDER_PRESENTATION_BACKEND_FAILED.rawValue))) | ||
| } | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes
terminationWatcherfrom private state to an internally readable property solely so a test can await it. That violates the repository directive against adding test-observability seams or widening members in productionSources/files for tests. Tests must instead observe behavior or access an appropriate internal declaration through@testable import. This repository requirement must be satisfied before merging.Rule Used: Do not add new test/debug seams (
ForTesting-style members, properties, or methods) to production source files underSources/. Tests must reach internal state via@testable importinstead. Existing occurrences are grandfathered but new ones are ... (source)Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!