mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-01 00:31:51 +03:00
fix(tui): align CI with supported platforms
Wait for terminal setup before asserting signal cleanup on slower Intel runners. Do not advertise a Windows ARM64 sidecar while Bun lacks the FFI support OpenTUI requires there. Co-authored-by: Bingxi Zhao <150592536+pancacake@users.noreply.github.com>
This commit is contained in:
+17
-2
@@ -641,10 +641,25 @@ if (process.platform !== "win32") {
|
||||
stdout: "pipe",
|
||||
stderr: "pipe",
|
||||
})
|
||||
await Bun.sleep(250)
|
||||
const decoder = new TextDecoder()
|
||||
let output = ""
|
||||
const collectOutput = (async () => {
|
||||
const reader = child.stdout.getReader()
|
||||
while (true) {
|
||||
const { done, value } = await reader.read()
|
||||
if (done) break
|
||||
output += decoder.decode(value, { stream: true })
|
||||
}
|
||||
output += decoder.decode()
|
||||
})()
|
||||
|
||||
// Slow Intel runners can spend more than 250 ms importing OpenTUI. Wait
|
||||
// for terminal setup, which happens after the signal handlers are
|
||||
// registered, before exercising shutdown.
|
||||
await waitUntil(() => output.includes("\x1b[?1049h"), 5_000)
|
||||
child.kill("SIGTERM")
|
||||
const exitCode = await child.exited
|
||||
const output = await new Response(child.stdout).text()
|
||||
await collectOutput
|
||||
const error = await new Response(child.stderr).text()
|
||||
|
||||
expect(exitCode).toBe(0)
|
||||
|
||||
Reference in New Issue
Block a user