Skip to content

flake: service-automation http-nodes「unknown host」用例依赖真实 DNS 查询,CI 上 5000ms 超时 #38126

Description

@objectstack-fleet

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Filing gate: ① (b) flake found by L1-a on PR #38114 (#37828): CI run 46099207334, job 140838130836, Test Core (5/10), head 214577c. The diff does not touch this package. Source: fleet.
Grading: area:build · Bug · p2 · reach: every PR whose Test Core shard runs service-automation; one red shard holds a PR out of review and out of the queue · evidence: one CI failure + code read.
Dedupe: "http-nodes no-such-host", "unknown host refusal timeout" → 0.

维护者速读

  • 问题:自动化服务里有个测试,用一个不存在的域名检查「访问未知主机会被拒」。它真的去做了一次 DNS 查询,CI 上查询偶尔超过 5 秒,测试就超时变红,跟 PR 改了什么没关系。
  • 修法:测试里把域名解析换成桩,不再依赖真实网络,被测的拒绝逻辑不变。
  • 要你做的:无。

Measured

Ask

  1. Both tests stub the host lookup (the resolver the egress check uses), so the unknown-host path is driven without a network. The refusal text and the "nothing of the lookup" assertion stay as they are.
  2. An ablation that shows the stub is what the test exercises. For example, with the stub resolving to a public address, the test goes red.

Acceptance

  • http-nodes.test.ts makes no real DNS query. Run with networking off, it passes.

Activity

  1. added
    bug
    priority:p2
    domain:server
    on Nov 28, 2026
  2. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:fleet · domain:devx · Bug · p2 · pm:queue · size XS; rationale: the service-automation http-nodes "unknown host" case depends on a real DNS lookup and timed out at 5000 ms on CI (one hit). A network-dependent test is a flake by construction; the fix is to stub the resolver. p2 for now, rising to p1 if it ejects a queue build or turns main red. Tests sit in area:fleet (area:build → area:fleet), linked under topic #38081. Recorded 2026-11-28T03:19Z.

  3. added
    domain:devx
    pm:queue
    and removed on Nov 28, 2026
  4. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW

    Claim: PM loop round 1
    Session: session_016WV4cxRDKprCtjpEdtiPFW
    Account: os-elon-musk
    Branch: claude/issue-38126-http-nodes-dns-stub
    Worktree: objectstack-issue-38126
    Domain: domain:devx
    Seat: repo:objectstack#1
    Area: o1-F
    File surface: packages/services/service-automation/src/builtin/http-nodes.test.ts only (the cases that fetch no-such-host.invalid); ⛔ not the egress check or http-nodes.ts
    Container & model: XS, mode:subagent, model: default (dispatch-gates --tier: no path-derived mandate), effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/services/service-automation/src/builtin/http-nodes.test.ts:271 in objectstack (the unknown-host case does a real DNS lookup) | none | every Test Core shard that runs service-automation; measured on PR #38114, job 140838130836
    Thread-read: 7232991548
    Premise: holds (run({ url: 'http://no-such-host.invalid/path' }) at http-nodes.test.ts:272 with no egress stub, and the same host at :293, on 10321fa)
    Serial constraints cleared: none — no claimed card in this area names this file
    Pre-claim lane: domain:devx per triage 7232991548; path packages/services/service-automation/** test file only, stays in this seat (留道).
    Pre-claim deps: none named.
    Prior rulings read: check-prior-rulings.mjs --card 38126 at 10321fa: 0 ruling comments in the thread; ADR candidates term-tier 1 only (ADR-0019 D2, ADR-0023 §3), none on egress tests. Card Ask verbatim: "The refusal text and the "nothing of the lookup" assertion stay as they are."

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 28, 2026
  6. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW
    os-dev-report

    {
      "issue": 38126,
      "status": "done",
      "branch": "claude/issue-38126-http-nodes-dns-stub",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38147",
      "session": "session_016WV4cxRDKprCtjpEdtiPFW",
      "premise_still_valid": true,
      "summary": "http-nodes.test.ts only (+25/-3, head fc05d4e861). The failed-call describe's run() now hands registerHttpNodes the real egress guard built with createEgressGuard({ policy: createEnvEgressPolicy({ allowedTargets: '127.0.0.1' }), resolve }) through the existing egress seam and the guard's documented test resolve option, so no product change. The stub answers ENOTFOUND for no-such-host.invalid, throws on any other name and records lookups; the two no-such-host.invalid cases (unknown host; path/query/userinfo secrets) assert the stub answered. Refusal text and not.toContain('ENOTFOUND') unchanged; ECONNREFUSED and timeout cases stay real undici on loopback. Every other case was checked: none performs a name lookup (stubbedFetchEgress, durable outbox, or no send).",
      "tests": "At fc05d4e861: vitest http-nodes.test.ts 19/19 passed; with a preload hook that records and hangs (DNS_HOOK=hang) or fails (DNS_HOOK=fail) every non-IP dns lookup: 19/19 passed, 0 lookups recorded. Control (origin/main version, hang): 2 failed (unknown host 5003ms, secrets 5002ms, 'Test timed out in 5000ms'), 2 lookups of no-such-host.invalid recorded = the CI flake reproduced. Ablation via scripts/ablation-replace.mjs (anchor x1->x0, blob a5bbfa63 -> a086d973): stub resolves no-such-host.invalid to 93.184.215.14 -> 2 failed ('expected Node http failed: HTTP 403 to match /http: EGRESS_REFUSED: /'); restored blob == HEAD blob, git diff HEAD empty. Package: typecheck (tsc + check:test-typecheck OK, 0 debt) and full vitest 297/297 files, 4342/4342 tests, lock VERDICT command-exit 0.",
      "gates": "dispatch-gates --commands (objectstack-ai/objectstack at fc05d4e8): 53 derived; --ran with exit codes: 53 accounted, 52 exit 0, 1 NOT MEASURED: check:dual-build-cjs-loads exit 3 PREREQUISITE NOT MET (needs whole-workspace dist; test-only diff). overlap-check.mjs: VERDICT clean exit 0. CI check-runs: in_progress at report time (not awaited, per contract).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — relay pr_create (POST /repos/objectstack-ai/objectstack/pulls + issues/38147/assignees + issues/38147/labels, one stroke, read-back identical); os-dev-report issue comment on #38126 via post-stamped. git push x2 (probe + commit) not REST.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  7. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW

    Landed · 2026-11-28T07:32Z · PR #38147 merged 2d95781690 at 2026-11-28T07:32Z (Fixes #38126). ACCEPT: in-area self-review on the PR (test only, ≤50 lines, Clause-②: no).

    • What changed: the http-nodes suite hands the real egress guard a resolve stub through the existing { egress } seam, so its two unknown-host cases no longer wait on real DNS (they timed out at 5000 ms when DNS hangs); the refusal assertions are unchanged.
    • Queue: ejected once by a runner shutdown (receipt on the PR, 7234777977) and re-enqueued once; merged on that pass.
    • Card state: pm:dispatched comes off in this stroke.
  8. removed
    pm:dispatched
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:fleetbugdomain:devxdomain:serverpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions