Skip to content

tests: intermittent ECONNRESET on first REST probe with freshly-provisioned credentials (arm64-biased) #69

Description

@mobileskyfi

Evidence

Two consecutive main.yml runs on 2026-07-05 (run 28728342669, first run + rerun) failed the linux/aarch64 integration leg with the SAME error class but DIFFERENT tests:

  • run 1: user provisioning > background mode: custom user created and accessible via RESTerror: The socket connection was closed unexpectedly. For more information, pass verbose: true in the second argument to fetch() (~42s)
  • rerun: instance lifecycle — remove and clean > clean() resets disk to factory defaults — same fetch() error (~42s)

The same suite passed on arm64 earlier the same day (runs 28723050898, 28727737748) — intermittent, arm64-biased. The arm64 REST ordering repro (test/lab) PASSED in the failing run, so the library's node:http path is fine.

Cause class

The error message is Bun's fetch() — but .github/instructions/general.instructions.md / routeros-rest.instructions.md ban fetch() for CHR REST precisely because of Bun's connection reuse against RouterOS (the documented sessions-008-017 lesson; src/lib/rest.ts exists because of it). The integration tests themselves still use raw fetch() against 127.0.0.1:<http>/rest/… in many places (provisioning.test.ts ×10+, start-stop.test.ts, others) — test code was never migrated when the library was.

Done-when

  • A small test helper (node:http, agent:false, custom-auth capable — thin wrapper over src/lib/rest.ts) replaces every fetch() call that targets a CHR REST endpoint in test/integration/ (external-URL fetches stay).
  • Full integration suite green on linux/x86_64 + linux/aarch64.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2active improvement with clear shapearea:ciCI workflows, publish, verification matrixarea:restRouterOS REST client behaviourbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions