Skip to content

Harden live FRED/BLS E2E against date alignment and network outages #631

Description

@luokerenx4

Symptom

On 2026-07-16, pnpm test:e2e passed 31 non-trading cases but failed two live macro-data assertions while src/domain/market-data/** was identical to origin/dev:

  1. fred_series multi-symbol returns rows with both columns populated returned rows, but none had both GDP and UNRATE populated on the same date (market-data.e2e.spec.ts:59). The failure reproduced in an isolated rerun.
  2. bls_series returns observations + skips missing periods returned HTTP 500 because the machine could not establish TLS to api.bls.gov (ECONNRESET). A direct curl reproduced LibreSSL SSL_connect: SSL_ERROR_SYSCALL.

Reproduction

pnpm test:e2e
pnpm vitest run --config vitest.e2e.config.ts \
  src/domain/market-data/__test__/e2e/market-data.e2e.spec.ts \
  -t "fred_series multi-symbol"

Suspected surface

  • src/domain/market-data/__test__/e2e/market-data.e2e.spec.ts
  • src/domain/market-data/__test__/e2e/setup.ts
  • FRED multi-series date/pivot semantics
  • policy for external-network failures in the otherwise non-trading E2E lane

Desired outcome

  • Keep deterministic join/pivot behavior covered with fixtures or a controlled provider response.
  • Keep an optional live-provider health lane for FRED/BLS.
  • Report unreachable upstream hosts as a clear live-lane skip/failure without making unrelated release PRs look regressed.
  • Define whether mixed-frequency series should produce sparse rows or an aligned/forward-filled table; make the assertion match that contract.

Why deferred

Discovered during provider/Workspace release-readiness verification. The current change does not touch market-data code, and mixing a macro-data contract change into that PR would obscure both reviews.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions