Skip to content

MockRequestExecutor calls requestHeadSent #517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2021

Conversation

fabianfett
Copy link
Member

Motivation

Our actual HTTPRequestExecutors send out a HTTPRequest as soon as they see it and they call willExecuteRequest and requestHeadSent in very fast succession on the HTTPExecutableRequest. We should have the same behavior in tests.

Changes

  • Call requestHeadSent from MockRequestExecutor.runRequest
  • Tests that use MockRequestExecutor call runRequest on it first

Result

Cleaner, more life like tests

@fabianfett fabianfett added the semver/none No version bump required. label Dec 4, 2021
@fabianfett fabianfett requested a review from dnadoba December 4, 2021 08:22
@fabianfett fabianfett merged commit 93de326 into swift-server:main Dec 6, 2021
@fabianfett fabianfett deleted the ff-auto-send-head branch December 6, 2021 08:17
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