Skip the stalled-download quit tests on Windows, and say why

Waking a recv blocked in another thread needs the handle closed on
Windows, which isn't safe under a TLS read (the previous commit, reverted
after review). A stalled download there holds the quit for the 4 s grace
period; its partial file is swept on the next start.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
saphidandClaude Opus 5.5 committed 2026-09-26 23:16:57 +10:00
1 parent 2f5ba5c086
commit 8f379db15e
2 files changed
+12

No files matched your search

+8
View File
@@ -148,3 +148,11 @@ The manifest's file URL must then be `http://localhost:8000/…` or
`frame_webinstall.dispatch()` and deletes the folder.
- The app registers the scheme each time it starts, so the last Frame Control
started (e.g. a development checkout) handles the links.
**Quitting during a stalled download.** On macOS and Linux, quitting stops a
download at once (`shutdown()` on its socket wakes the blocked read). On
Windows that doesn't wake a read in another thread, and closing the handle
under a TLS read isn't safe, so a download that has stalled holds the quit for
the 4-second grace period until the app stops the server; the partial file is
removed on the next start. Downloads that are still moving stop at their next
read either way.
+4
View File
@@ -328,6 +328,10 @@ class ServerJobs(unittest.TestCase):
self.assertEqual((job["phase"], job["message"]), ("done", "ok"))
def stall_then_shutdown(self, scheme, reply):
if os.name == "nt":
# shutdown() from another thread doesn't wake a blocked recv on Windows, and
# closing the handle under a TLS read isn't safe; see web-install.md.
self.skipTest("Windows: a stalled download is only dropped when the app stops the server")
"""Start a download from a server that stalls after sending reply; shutdown must stop it quickly."""
stall = socket.socket()
stall.bind(("127.0.0.1", 0))