Skip to content

3 PipelineTests disposal tests cannot distinguish who disposed the content #448

Open

Description

@Blind-Striker

Three Transport/PipelineTests tests end with a positive disposal assertion, content.IsDisposed is true:

Test (at master 3b235436) Assertion
ExecuteAsync_Should_Fail_A_Body_That_Stalls_Past_The_Progress_Window (:857) content.IsDisposed (:888)
ExecuteAsync_Should_Fail_A_Stalled_Error_Body_At_The_Progress_Window_Under_NoThrow (:949) content.IsDisposed (:975)
ExecuteAsync_Should_Classify_A_Fault_The_Interruption_Caused_As_A_Transport_Failure_At_The_Progress_Window (:1059) content.IsDisposed (:1089)

The assertion cannot tell who disposed the content, or when. In TST-E4a P01b, a scratch mutant disposed each test's handler, HttpClient and Pipeline immediately after the operation and before the assertions. All three tests still passed. "The pipeline disposed the response content on failure" and "something disposed everything early" look the same to these oracles.

Why it matters: the rule these tests are named for (the pipeline releases the failed body itself) has no oracle that fails when the pipeline does not do it, as long as something else disposes the content first. The weakness exists today, with or without a shared helper.

Consequence for TST-E4: these three tests keep their explicit triples for now. Two of the three clone pairs that TST-E4 must remove (114 and 56 tokens, tools/jscpd/tests.baseline.json) stay until the oracles are strengthened. The lead decided this on 2026-10-17: removing the pairs is sequenced after the strengthening, not dropped.

Suggested fix (a later TST-E4 PR): strengthen each oracle so it fails when disposal happens at the wrong time or by the wrong owner. For example, assert the content is not disposed before the pipeline call ends and is disposed after it, or use a probe content that records the disposal point (the pipeline's own path versus test teardown). Then rerun the per-test early-disposal injection. Once it is killed, the tests move to the shared PipelineScenario under its lifecycle guard, and both clone pairs leave the baseline.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions