Skip to content

Integration-test Stream doubles do not honour the close-on-failure half of the contract #727

Description

@DavidCozens

Problem

SolidSyslogStreamDefinition.h requires a Stream implementation to close internally on a failed Send and before returning a negative Read, so the caller can reopen and store-and-forward can replay.

The two integration-test transports — Tests/MbedTlsIntegration/SocketStream.c and Tests/OpenSslIntegration/BioPairStream.c — do not do this. They are the transports the TLS integration tests run over, so the tests exercise the adapter against a peer that does not behave as the contract says a Stream behaves.

Surfaced by a CodeRabbit comment on PR #711.

Why it is worth doing

Not a product defect: these are test doubles and nothing ships them. It matters because they sit underneath contract tests. A double that is more forgiving than the contract can hide a reconnect path that would misbehave against a conforming one, which is the failure mode these tests exist to catch.

Options

  1. Make both doubles conform — close on failed Send and before a negative Read. Preferred; it is a few lines each and makes the test peer honest.
  2. Leave them and state in each file that the double is deliberately permissive and which clauses it does not implement, so the next reader does not mistake it for a reference.

Option 1 unless it turns out the tests depend on the permissive behaviour, in which case option 2 with the reason recorded.

Acceptance criteria

  • Both doubles either honour the close-on-failure clauses or carry a comment naming the clauses they deliberately do not implement, and why.
  • The OpenSSL and mbedTLS integration lanes stay green.
  • No production code changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreMaintenance, tooling, and infrastructure

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions