tracker
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
- 06f6ae8fHM62 report: mpackdb index gapmre
- 86fe5430log: HM62 startedmre
- 755307bbmission HM62mre
- 4b2f2995HM61 report: tracker#61 packed people ordermre
- 48faa84flog: #60 deploy startedmre
- 90734c6cMerge branch 'hm60-shortids'mre
- e0db0d1bHM60 report: tracker#60 packed short-ID ownersmre
- 3c79b576Pack short-ID ownership into byte buffersmre
- e822524bstatus wordingmre
- 1c7f0480log: HM60/HM61 startedmre
- 2841d215missions HM60 HM61mre
- 289c6ce4HM1 report: heap object breakdownmre
- 2e7d6257log: HM1 startedmre
- 2f790465mission HM1: heap object breakdownmre
- a18957falog: evening re-measure after CBmre
- aac9a98dlog: evening re-measure startmre
- 45163bd4log: person/tmdb error hypothesismre
- cb38de2blog: swap 503 causemre
- fd10c3d5log: CB livemre
- 7557c025log: CB deploy try 2mre