gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite7512d00e7512d00status: #36 rolled back, retry askedmree7512d00/plugins/fetch/tests/refused-catch.mjs

1.3 KB

  1. // refused-catch.mjs — mission 517 (hybriel#240). A fetch to a closed port, an unknown host
  2. // and a closed https port must each give an error `on Error` can catch, with the host:port and
  3. // the reason in the message, and the program must run on to its end.
  4. import { spawnSync } from 'node:child_process';
  5. import net from 'node:net';
  6. import path from 'node:path';
  7. import { fileURLToPath } from 'node:url';
  8. const HERE = path.dirname(fileURLToPath(import.meta.url));
  9. const ROOT = path.resolve(HERE, '../../..');
  10. const BIN = process.env.HL_BIN || path.resolve(ROOT, 'native/zig-out/bin/hybriel');
  11. // Find a port nothing listens on: bind one, note it, close it.
  12. const probe = net.createServer();
  13. await new Promise((r) => probe.listen(0, '127.0.0.1', r));
  14. const port = probe.address().port;
  15. await new Promise((r) => probe.close(r));
  16. const r = spawnSync(BIN, [path.join(HERE, 'refused_catch.hl')], {
  17. env: { ...process.env, HL_TEST_PORT: String(port) }, encoding: 'utf8', timeout: 60000,
  18. });
  19. const log = (r.stdout || '') + (r.stderr || '');
  20. const ok = r.status === 0
  21. && log.includes(`127.0.0.1:${port}/x: connection refused`)
  22. && log.includes('could not resolve host')
  23. && log.includes('done 3 true true true');
  24. if (ok) { console.log('PASS refused, https refused and unknown host are caught'); process.exit(0); }
  25. console.log(`FAIL exit ${r.status}\n` + log.slice(-1500));
  26. process.exit(1);

Branches

Latest commits

  • e7512d00status: #36 rolled back, retry askedmre
  • c98e2043log: T36A rollbackmre
  • ae905f15Merge t36a: tracker#36 apply rechecks, reportmre
  • 796bfaceT36A: report validated fixes, failed live SSH check and verified rollbackmre
  • 55257852log: #53 live, #56 mergedmre
  • 78b39f1bMerge hm56-rows: tracker#56 list builders insert oncemre
  • 7aea52batmdb fix: protect owners without slugs and record passing gatesmre
  • 9b3c2559tmdb fix: revalidate planned identities and reserve target idsmre
  • 6da612fclog: T36A tool defectmre
  • d56ee0daT36A: report unsafe TMDB apply revalidation and stop before livemre
  • 08e55255log: HM56 done, T36A startedmre
  • 91bcdf0eAvoid per-row list copies and reproduce keyed-row blockersmre
  • 5fd2ac75status: #36 GOmre
  • 0d253b45mission: T36Amre
  • 2aa22d23log: #36 GOmre
  • 833aee2flog: #50 closed, HM56 startedmre
  • ac58c1e5mission: HM56mre
  • 58979c0clog: HM54 held for decision, DP65 startedmre
  • bb2ebc67log: #64 live, #53 mergedmre
  • 27cde42fMerge hm53-dom: tracker#53 inputs bound to membersmre