Skip to content

Commit 8a53cc8

Browse files
committed
ci: stabilize full test shards
1 parent 1335f89 commit 8a53cc8

6 files changed

Lines changed: 45 additions & 4 deletions

File tree

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ LS_PORT=42100
6565
# Native Cascade tool bridge. Default off because Cascade executes native
6666
# Read/Bash-style tools in the remote Windsurf workspace, while most clients
6767
# expect local execution.
68-
# v2.0.138 production canary scope is intentionally narrow: without an
68+
# v2.0.139 production canary scope is intentionally narrow: without an
6969
# explicit tool allowlist, only Bash / shell_command / run_command can route
7070
# through the native bridge. Read/Grep/Glob/WebSearch/WebFetch are protocol
7171
# matrix work, not production defaults. For local IDE tools (Claude Code,
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# v2.0.139 - full CI shard hotfix
2+
3+
## What changed
4+
5+
- Fixed `test/audit-fixes.test.js` on Linux by using `fileURLToPath(import.meta.url)` instead of manually stripping the leading slash from `import.meta.url`.
6+
- Fixed fake HTTP/2 language-server tests to close/destroy active sessions before `server.close()`, preventing CI shard timeouts in `test/client-panel-retry.test.js` and `test/native-read-wrapper.test.js`.
7+
- Bumped the package version and native-bridge canary note to v2.0.139.
8+
9+
## Context
10+
11+
v2.0.138 Release, Docker build, and GitHub Release succeeded. The newly restored full CI shards then exposed these test-harness portability/resource-cleanup issues. This release keeps the v2.0.138 product changes and makes the full CI gate green.
12+
13+
## Validation
14+
15+
- `node --test --test-force-exit test/audit-fixes.test.js`
16+
- `node --test --test-force-exit test/client-panel-retry.test.js`
17+
- `node --test --test-force-exit test/native-read-wrapper.test.js`
18+
- `npm.cmd run test:release`
19+
- `npm.cmd run test:shard -- 0 4 --timeout-ms=90000`
20+
- `npm.cmd run test:shard -- 1 4 --timeout-ms=90000`
21+
- `npm.cmd run test:shard -- 2 4 --timeout-ms=90000`
22+
- `npm.cmd run test:shard -- 3 4 --timeout-ms=90000`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "windsurf-api",
3-
"version": "2.0.138",
3+
"version": "2.0.139",
44
"description": "Windsurf to OpenAI + Anthropic compatible API proxy. Turns Windsurf's 107 AI models (Claude, GPT, Gemini, DeepSeek, Grok, Qwen, Kimi, GLM, SWE) into dual-protocol API endpoints. Zero npm deps.",
55
"type": "module",
66
"main": "src/index.js",

test/audit-fixes.test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import { describe, test } from 'node:test';
2020
import assert from 'node:assert/strict';
2121
import { mkdtempSync, readFileSync, writeFileSync, existsSync, rmSync, readdirSync } from 'node:fs';
2222
import { tmpdir } from 'node:os';
23-
import { join } from 'node:path';
23+
import { dirname, join } from 'node:path';
24+
import { fileURLToPath } from 'node:url';
2425

2526
import { writeJsonAtomic } from '../src/fs-atomic.js';
2627
import { cacheKey } from '../src/cache.js';
@@ -176,7 +177,7 @@ describe('atomic write call sites use writeJsonAtomic', () => {
176177
// helper instead of writeFileSync. A future refactor that drops
177178
// the import without re-introducing tmp+rename should fail this
178179
// test rather than silently regress to the truncated-JSON bug.
179-
const __dirname = new URL('.', import.meta.url).pathname.replace(/^\//, '');
180+
const __dirname = dirname(fileURLToPath(import.meta.url));
180181
const ROOT = join(__dirname, '..');
181182
const FILES = [
182183
'src/runtime-config.js',

test/client-panel-retry.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,21 @@ function setEnvForTest(values) {
164164

165165
async function withFakeLanguageServer(handler, fn) {
166166
const server = http2.createServer();
167+
const sessions = new Set();
168+
server.on('session', session => {
169+
sessions.add(session);
170+
session.on('close', () => sessions.delete(session));
171+
});
167172
server.on('stream', handler);
168173
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
169174
const port = server.address().port;
170175
try {
171176
return await fn(port);
172177
} finally {
178+
for (const session of sessions) {
179+
try { session.close(); } catch {}
180+
try { session.destroy(); } catch {}
181+
}
173182
await new Promise(resolve => server.close(resolve));
174183
}
175184
}

test/native-read-wrapper.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,21 @@ function trajectoryStepsResponse(...steps) {
8181

8282
async function withFakeLanguageServer(handler, fn) {
8383
const server = http2.createServer();
84+
const sessions = new Set();
85+
server.on('session', session => {
86+
sessions.add(session);
87+
session.on('close', () => sessions.delete(session));
88+
});
8489
server.on('stream', handler);
8590
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
8691
const port = server.address().port;
8792
try {
8893
return await fn(port);
8994
} finally {
95+
for (const session of sessions) {
96+
try { session.close(); } catch {}
97+
try { session.destroy(); } catch {}
98+
}
9099
await new Promise(resolve => server.close(resolve));
91100
}
92101
}

0 commit comments

Comments
 (0)