fix: stabilize windows CI (#558) (thanks @carlulsoe)
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
- macOS: add node bridge heartbeat pings to detect half-open sockets and reconnect cleanly. (#572) — thanks @ngutman
|
- macOS: add node bridge heartbeat pings to detect half-open sockets and reconnect cleanly. (#572) — thanks @ngutman
|
||||||
- Node bridge: harden keepalive + heartbeat handling (TCP keepalive, better disconnects, and keepalive config tests). (#577) — thanks @steipete
|
- Node bridge: harden keepalive + heartbeat handling (TCP keepalive, better disconnects, and keepalive config tests). (#577) — thanks @steipete
|
||||||
|
- Control UI: improve mobile responsiveness. (#558) — thanks @carlulsoe
|
||||||
- CLI: add `sandbox list` and `sandbox recreate` commands for managing Docker sandbox containers after image/config updates. (#563) — thanks @pasogott
|
- CLI: add `sandbox list` and `sandbox recreate` commands for managing Docker sandbox containers after image/config updates. (#563) — thanks @pasogott
|
||||||
- Providers: add Microsoft Teams provider with polling, attachments, and CLI send support. (#404) — thanks @onutc
|
- Providers: add Microsoft Teams provider with polling, attachments, and CLI send support. (#404) — thanks @onutc
|
||||||
- Commands: accept /models as an alias for /model.
|
- Commands: accept /models as an alias for /model.
|
||||||
|
|||||||
@@ -56,7 +56,11 @@ async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
|||||||
const previousUserProfile = process.env.USERPROFILE;
|
const previousUserProfile = process.env.USERPROFILE;
|
||||||
const previousHomeDrive = process.env.HOMEDRIVE;
|
const previousHomeDrive = process.env.HOMEDRIVE;
|
||||||
const previousHomePath = process.env.HOMEPATH;
|
const previousHomePath = process.env.HOMEPATH;
|
||||||
|
const previousStateDir = process.env.CLAWDBOT_STATE_DIR;
|
||||||
|
const previousClawdisStateDir = process.env.CLAWDIS_STATE_DIR;
|
||||||
process.env.HOME = base;
|
process.env.HOME = base;
|
||||||
|
process.env.CLAWDBOT_STATE_DIR = join(base, ".clawdbot");
|
||||||
|
process.env.CLAWDIS_STATE_DIR = join(base, ".clawdbot");
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
process.env.USERPROFILE = base;
|
process.env.USERPROFILE = base;
|
||||||
const driveMatch = base.match(/^([A-Za-z]:)(.*)$/);
|
const driveMatch = base.match(/^([A-Za-z]:)(.*)$/);
|
||||||
@@ -74,6 +78,8 @@ async function withTempHome<T>(fn: (home: string) => Promise<T>): Promise<T> {
|
|||||||
process.env.USERPROFILE = previousUserProfile;
|
process.env.USERPROFILE = previousUserProfile;
|
||||||
process.env.HOMEDRIVE = previousHomeDrive;
|
process.env.HOMEDRIVE = previousHomeDrive;
|
||||||
process.env.HOMEPATH = previousHomePath;
|
process.env.HOMEPATH = previousHomePath;
|
||||||
|
process.env.CLAWDBOT_STATE_DIR = previousStateDir;
|
||||||
|
process.env.CLAWDIS_STATE_DIR = previousClawdisStateDir;
|
||||||
await fs.rm(base, { recursive: true, force: true });
|
await fs.rm(base, { recursive: true, force: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ function sendLine(socket: net.Socket, obj: unknown) {
|
|||||||
socket.write(`${JSON.stringify(obj)}\n`);
|
socket.write(`${JSON.stringify(obj)}\n`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function waitForSocketConnect(socket: net.Socket) {
|
||||||
|
if (!socket.connecting) return;
|
||||||
|
await new Promise<void>((resolve, reject) => {
|
||||||
|
socket.once("connect", resolve);
|
||||||
|
socket.once("error", reject);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
describe("node bridge server", () => {
|
describe("node bridge server", () => {
|
||||||
let baseDir = "";
|
let baseDir = "";
|
||||||
|
|
||||||
@@ -156,6 +164,7 @@ describe("node bridge server", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const socket = net.connect({ host: "127.0.0.1", port: server.port });
|
const socket = net.connect({ host: "127.0.0.1", port: server.port });
|
||||||
|
await waitForSocketConnect(socket);
|
||||||
const readLine = createLineReader(socket);
|
const readLine = createLineReader(socket);
|
||||||
sendLine(socket, { type: "pair-request", nodeId: "n2", platform: "ios" });
|
sendLine(socket, { type: "pair-request", nodeId: "n2", platform: "ios" });
|
||||||
|
|
||||||
@@ -189,6 +198,7 @@ describe("node bridge server", () => {
|
|||||||
socket.destroy();
|
socket.destroy();
|
||||||
|
|
||||||
const socket2 = net.connect({ host: "127.0.0.1", port: server.port });
|
const socket2 = net.connect({ host: "127.0.0.1", port: server.port });
|
||||||
|
await waitForSocketConnect(socket2);
|
||||||
const readLine2 = createLineReader(socket2);
|
const readLine2 = createLineReader(socket2);
|
||||||
sendLine(socket2, { type: "hello", nodeId: "n2", token });
|
sendLine(socket2, { type: "hello", nodeId: "n2", token });
|
||||||
const line3 = JSON.parse(await readLine2()) as { type: string };
|
const line3 = JSON.parse(await readLine2()) as { type: string };
|
||||||
@@ -239,6 +249,7 @@ describe("node bridge server", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const socket = net.connect({ host: "127.0.0.1", port: server.port });
|
const socket = net.connect({ host: "127.0.0.1", port: server.port });
|
||||||
|
await waitForSocketConnect(socket);
|
||||||
const readLine = createLineReader(socket);
|
const readLine = createLineReader(socket);
|
||||||
sendLine(socket, {
|
sendLine(socket, {
|
||||||
type: "pair-request",
|
type: "pair-request",
|
||||||
@@ -248,7 +259,7 @@ describe("node bridge server", () => {
|
|||||||
|
|
||||||
// Approve the pending request from the gateway side.
|
// Approve the pending request from the gateway side.
|
||||||
let reqId: string | undefined;
|
let reqId: string | undefined;
|
||||||
for (let i = 0; i < 40; i += 1) {
|
for (let i = 0; i < 120; i += 1) {
|
||||||
const list = await listNodePairing(baseDir);
|
const list = await listNodePairing(baseDir);
|
||||||
const req = list.pending.find((p) => p.nodeId === "n3-rpc");
|
const req = list.pending.find((p) => p.nodeId === "n3-rpc");
|
||||||
if (req) {
|
if (req) {
|
||||||
|
|||||||
Reference in New Issue
Block a user