kunibert
All repositories: gitoria
1.3 KB
// refused-catch.mjs — mission 517 (hybriel#240). A fetch to a closed port, an unknown host// and a closed https port must each give an error `on Error` can catch, with the host:port and// the reason in the message, and the program must run on to its end.import { spawnSync } from 'node:child_process';import net from 'node:net';import path from 'node:path';import { fileURLToPath } from 'node:url';const HERE = path.dirname(fileURLToPath(import.meta.url));const ROOT = path.resolve(HERE, '../../..');const BIN = process.env.HL_BIN || path.resolve(ROOT, 'native/zig-out/bin/hybriel');// Find a port nothing listens on: bind one, note it, close it.const probe = net.createServer();await new Promise((r) => probe.listen(0, '127.0.0.1', r));const port = probe.address().port;await new Promise((r) => probe.close(r));const r = spawnSync(BIN, [path.join(HERE, 'refused_catch.hl')], {env: { ...process.env, HL_TEST_PORT: String(port) }, encoding: 'utf8', timeout: 60000,});const log = (r.stdout || '') + (r.stderr || '');const ok = r.status === 0&& log.includes(`127.0.0.1:${port}/x: connection refused`)&& log.includes('could not resolve host')&& log.includes('done 3 true true true');if (ok) { console.log('PASS refused, https refused and unknown host are caught'); process.exit(0); }console.log(`FAIL exit ${r.status}\n` + log.slice(-1500));process.exit(1);
Branches
Latest commits
- e73995a3log: hycon PR 314 approved after fresh reviewmre
- f60427falog: hycon PR 314 false tool errormre
- 481974f7log: Hermes accepts PR 259 findingmre
- bb0976acrecords: hycon PR 259 design findingmre
- 5c637c24records: hycon PR 259 false tool errormre
- a344c406log: routger 132 reviewedmre
- 56e70dcbrecords: review time limit 1800 s (routger 132)mre
- c3a304c5Merge branch 'job-timeout' into mainKunibert
- 402bfeb0|||PR runner: the model run uses the job's time limit (jobTimeoutSeconds), not a fixed 900 smre
- 8d34ca33records: repo rename (gitoria#53)mre
- 1e05cb3fMerge branch 'repo-rename' into mainKunibert
- 6ee0d2e9|||PR intake: match a delivery by repo.id and signature, not URLs (gitoria#53 rename)mre
- 900ffcd4status: routgermre
- 59b0b793log: routger merge waitmre
- e52f094alog: routger intake check (hycon#122)mre
- f979027frecords: design rule livemre
- 71efaf84Merge branch 'design-guard' into mainKunibert
- c0656581|||PR Flag removal of a documented design as major unless his recorded yes is linked; rules version 5mre
- 901cdd75records: L10 update 2 livemre
- 4a68016bMerge branch 'hl-standard-l10b' into mainKunibert