Skip to content

URLSession: Update all task types with the byte count of sent data #2760

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
Apr 5, 2020

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Apr 5, 2020

  • urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)
    was only sent to tasks of type URLSesisonUploadTask, but testing showed
    it should be sent to all task types.

  • Update tests that now see an extra delegate callback of this method.

  • test_simpleUploadWithDelegateProvidingInputStream was flaky due to the
    expectation sometimes being fulfilled multiple times as it was
    fulfilled in the urlSession(_:dataTask:didReceive:) delegate.

  • Migrate this test to the SessionDelegate and add extra tests to check
    the response and delegate callbacks for each HTTP method.

  • For HTTPUploadDelegate, add the expectation fulfilment to a delegate
    callback for urlSession(_ :task:didCompleteWithError:) so that
    test_simpleUploadWithDelegate() still works.

- urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)
  was only sent to tasks of type URLSesisonUploadTask, but testing showed
  it should be sent to all task types.

- Update tests that now see an extra delegate callback of this method.

- test_simpleUploadWithDelegateProvidingInputStream was flaky due to the
  expectation sometimes being fulfilled multiple times as it was
  fulfilled in the urlSession(_:dataTask:didReceive:) delegate.

- Migrate this test to the SessionDelegate and add extra tests to check
  the response and delegate callbacks for each HTTP method.

- For HTTPUploadDelegate, add the expectation fulfilment to a delegate
  callback for urlSession(_ :task:didCompleteWithError:) so that
  test_simpleUploadWithDelegate() still works.
@spevans
Copy link
Contributor Author

spevans commented Apr 5, 2020

@swift-ci test

@spevans spevans merged commit 99f82c6 into swiftlang:master Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant