Skip to content

Add a hook to customise client connection pipeline in tests - #144

Merged
aryan-25 merged 4 commits into
swift-server:mainfrom
aryan-25:customise-client-connection-pipeline
Oct 2, 2026
Merged

aryan-25 merged 4 commits into
swift-server:mainfrom
aryan-25:customise-client-connection-pipeline

Conversation

@aryan-25

@aryan-25 aryan-25 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

There are two tests in HTTP3DatagramTests which set up a client-server connection and test for reading/writing unreliable datagrams on the connection.

The client handler in these tests immediately starts writing datagrams without waiting for the server's SETTINGS frame to arrive. If the write happens to occur before the SETTINGS arrive, the underlying swift-nio-http3 stack drops the write. This results in the test hanging until the connection idle timeout closes the connection, at which point all #expect/#require assertions fail.

We have run into this race in some CI runs over the past few days.

Modifications

  • Added a new configuration option named additionalConnectionChannelInitializer to TestHelpers.ClientConfiguration. This can be used to add additional handlers to the connection pipeline in tests.
  • Updated the affected tests to:
    1. Add a handler to the connection channel which succeeds a provided promise when the server has confirmed that it supports unreliable datagrams (through the SETTINGS frame), and;
    2. Wait for the result of the promise before writing unreliable datagrams.

Result

The affected tests in HTTP3DatagramTests are now more reliable.

@aryan-25 aryan-25 added the semver/none No version bump required. label Oct 1, 2026
@aryan-25
aryan-25 merged commit 8c6c7d2 into swift-server:main Oct 2, 2026
21 of 26 checks passed
@aryan-25
aryan-25 deleted the customise-client-connection-pipeline branch October 2, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants