openvibers/openvibe.games Commits
Run the slice test on a free port with a longer server start timeout
Changes
nnew file mode 120000@@@ -0,0 +1 @@++/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/client/node_modules\\ No newline at end of filennew file mode 120000@@@ -0,0 +1 @@++/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/server/node_modules\\ No newline at end of file@@@ -10,6 +10,7 @@* Run: tsx apps/server/scripts/sliceTest.ts*/import { spawn, type ChildProcess } from 'node:child_process'++import { createServer } from 'node:net'import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'import { tmpdir } from 'node:os'import { join } from 'node:path'@@@ -30,7 +31,16 @@ import {import { encodeHeights } from '@openvibe/content'import { quantiseAngle } from '@openvibe/shared'--const PORT = 18123++// A port the OS hands out, not a fixed one: the checks and the verify job can run the slice at the++// same time on one machine. Chosen once, so the restart test comes back on the same address.++const PORT = await new Promise<number>((resolvePort, reject) => {++ const probe = createServer()++ probe.once('error', reject)++ probe.listen(0, '127.0.0.1', () => {++ const address = probe.address()++ probe.close(() => resolvePort(typeof address === 'object' && address ? address.port : 0))++ })++})const URL = `ws://127.0.0.1:${PORT}/ws`const dir = mkdtempSync(join(tmpdir(), 'openvibe-slice-'))@@@ -99,7 +109,8 @@ function startServer(): Promise<void> {},stdio: ['ignore', 'pipe', 'pipe'],})-- const timer = setTimeout(() => reject(new Error('server did not start')), 30000)++ // Cold start compiles PGlite and Rapier (a few seconds idle); on a loaded machine 30 s was not enough.++ const timer = setTimeout(() => reject(new Error('server did not start')), 120_000)server.stdout?.on('data', (chunk: Buffer) => {const text = chunk.toString()if (process.env.SLICE_DEBUG) process.stdout.write(` [srv] ${text}`)nnew file mode 120000@@@ -0,0 +1 @@++/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/content/node_modules\\ No newline at end of filennew file mode 120000@@@ -0,0 +1 @@++/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/gameplay/node_modules\\ No newline at end of filennew file mode 120000@@@ -0,0 +1 @@++/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/persistence/node_modules\\ No newline at end of filennew file mode 120000@@@ -0,0 +1 @@++/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/physics/node_modules\\ No newline at end of filennew file mode 120000@@@ -0,0 +1 @@++/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/protocol/node_modules\\ No newline at end of file
new file mode 120000
new file mode 120000
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/client/node_modules
\ No newline at end of file
\ No newline at end of file
new file mode 120000
new file mode 120000
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/apps/server/node_modules
\ No newline at end of file
\ No newline at end of file
@@ -10,6 +10,7 @@
@@ -10,6 +10,7 @@
* Run: tsx apps/server/scripts/sliceTest.ts
* Run: tsx apps/server/scripts/sliceTest.ts
*/
*/
import { spawn, type ChildProcess } from 'node:child_process'
import { spawn, type ChildProcess } from 'node:child_process'
+import { createServer } from 'node:net'
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
import { join } from 'node:path'
@@ -30,7 +31,16 @@ import {
@@ -30,7 +31,16 @@ import {
import { encodeHeights } from '@openvibe/content'
import { encodeHeights } from '@openvibe/content'
import { quantiseAngle } from '@openvibe/shared'
import { quantiseAngle } from '@openvibe/shared'
-const PORT = 18123
+// A port the OS hands out, not a fixed one: the checks and the verify job can run the slice at the
+// same time on one machine. Chosen once, so the restart test comes back on the same address.
+const PORT = await new Promise<number>((resolvePort, reject) => {
+ const probe = createServer()
+ probe.once('error', reject)
+ probe.listen(0, '127.0.0.1', () => {
+ const address = probe.address()
+ probe.close(() => resolvePort(typeof address === 'object' && address ? address.port : 0))
+ })
+})
const URL = `ws://127.0.0.1:${PORT}/ws`
const URL = `ws://127.0.0.1:${PORT}/ws`
const dir = mkdtempSync(join(tmpdir(), 'openvibe-slice-'))
const dir = mkdtempSync(join(tmpdir(), 'openvibe-slice-'))
@@ -99,7 +109,8 @@ function startServer(): Promise<void> {
@@ -99,7 +109,8 @@ function startServer(): Promise<void> {
},
},
stdio: ['ignore', 'pipe', 'pipe'],
stdio: ['ignore', 'pipe', 'pipe'],
})
})
- const timer = setTimeout(() => reject(new Error('server did not start')), 30000)
+ // Cold start compiles PGlite and Rapier (a few seconds idle); on a loaded machine 30 s was not enough.
+ const timer = setTimeout(() => reject(new Error('server did not start')), 120_000)
server.stdout?.on('data', (chunk: Buffer) => {
server.stdout?.on('data', (chunk: Buffer) => {
const text = chunk.toString()
const text = chunk.toString()
if (process.env.SLICE_DEBUG) process.stdout.write(` [srv] ${text}`)
if (process.env.SLICE_DEBUG) process.stdout.write(` [srv] ${text}`)
new file mode 120000
new file mode 120000
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/content/node_modules
\ No newline at end of file
\ No newline at end of file
new file mode 120000
new file mode 120000
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/gameplay/node_modules
\ No newline at end of file
\ No newline at end of file
new file mode 120000
new file mode 120000
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/persistence/node_modules
\ No newline at end of file
\ No newline at end of file
new file mode 120000
new file mode 120000
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/physics/node_modules
\ No newline at end of file
\ No newline at end of file
new file mode 120000
new file mode 120000
@@ -0,0 +1 @@
@@ -0,0 +1 @@
+/mnt/120gb/openvibe-worktrees/OpenVibe.Games-agent-games-follow-up-of-https-github-com-open-081839-mus4ed3w-finish/packages/protocol/node_modules
\ No newline at end of file
\ No newline at end of file