Skip to content

7 integration tests in client.test.ts skipped during Bun migration (hangs/timeouts) #46

@evans-sam

Description

@evans-sam

Summary

During the Bun migration, 7 integration tests in `test/client.test.ts` (14 counting `SOAP Client` / `SOAP Client (with streaming)` variants) were marked `it.skip` because they hang past the 5s timeout without calling `done()`. Root cause is not the Bun migration itself — the tests have never actually run on this codebase (lib/ had ERR_MODULE_NOT_FOUND, see #43). Bun is the first environment to actually execute them.

Skipped tests

  1. `should issue async callback for cached wsdl`
  2. `should issue async promise for cached wsdl`
  3. `should allow passing in XML strings`
  4. `should send binary attachments using XOP + MTOM` (Binary attachments handling)
  5. `Should preserve SOAP 1.2 "action" header when sending MTOM request`
  6. `Should send MTOM request even without attachment`
  7. `should add proper headers for soap12` (Headers in request and last response)

Symptom pattern

All failures share the shape:

```
(fail) SOAP Client > [5000.XX ms]
^ this test timed out after 5000ms, before its done callback was called.
```

No assertion failure is raised — the callback chain from `soap.createClient` / `client.MyOperation` never completes. Server is started, request is presumably issued, but no response/error reaches the SOAP callback.

Likely categories

  • Cached-wsdl async callback: asserts the callback fires after the synchronous `assert(!called)` check, i.e., that `soap.createClient` schedules its callback asynchronously even when the WSDL is already cached. May indicate a src path that resolves synchronously from cache, breaking the expectation, or the opposite (never firing).
  • MTOM / binary attachments / soap12 headers: integration paths that exercise the src/http.ts response-parsing code for multipart content-types or specific header handling. May have real src/ defects that were never caught because the suite never ran.
  • XML string passing: client.MyOperation with `_xml` string argument — sends raw XML, server returns pre-baked envelope. Should exercise the simplest possible send/receive but times out.

Reproduction

```
bun test test/client.test.ts -t "should issue async callback for cached wsdl"
bun test test/client.test.ts -t "should allow passing in XML strings"

etc.

```

Each hangs for exactly 5000ms before timing out.

Suggested investigation

  1. Remove one `.skip` at a time and run with `--timeout 30000` + `BUN_TEST_TRACE_EVENTS=1` or similar to see where the callback chain stops.
  2. Compare what happens under node (via the published lib/ once Published lib/ uses extensionless ESM imports; pure Node consumers hit ERR_MODULE_NOT_FOUND #43 is fixed) — if tests pass there, the issue is Bun-specific runtime behavior. If they fail there too, it's pre-existing src/ bugs exposed by tests actually running.
  3. Likely suspects per category:
    • cached-wsdl: `src/soap.ts` / `src/client.ts` WSDL cache retrieval path.
    • MTOM: `src/http.ts` multipart response parsing, `parseMTOMResp` — note the `if (!boundary)` branch calls `callback(err); throw err;` which was a known pattern (see commit d18c520 for the similar issue in the main catch handler).
    • XML string: `client.MyOperation({ _xml: xmlStr }, ...)` path in `src/client.ts`.

Context

This issue is a checklist of investigations, not a single-PR fix. Each skipped test likely has its own root cause. Unblocks removing the `.skip` markers added in commit 00b0b6b.

Related: #43 (extensionless lib/ imports), #45 (err.root on non-Fault parse errors).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions