Skip to content
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

Disable NSURLSession DownloadTaskWithURL_WithCancelResume test #1740

Merged
merged 2 commits into from
Jan 20, 2017

Conversation

aballway
Copy link
Contributor

@aballway aballway commented Jan 19, 2017

It seems NSURLSession DownloadTaskWithURL_WithCancelResume is still finnicky. This disables the test until a better testing method is implemented.


This change is Reviewable

[NSThread sleepForTimeInterval:0.5];
currentBytesDownloaded = (double)downloadTaskTestHelper.totalBytesWritten / 1024 / 1024;
ASSERT_EQ_MSG(currentBytesDownloaded, lastBytesDownloaded, "FAILED: File download should have stopped!");
ASSERT_EQ(NSURLSessionTaskStateCanceling, downloadTask.state);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it still be "canceling but not cancelled" at this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it Canceling is "Cancelled"

[NSThread sleepForTimeInterval:0.5];
lastBytesDownloaded = currentBytesDownloaded;
currentBytesDownloaded = (double)downloadTaskTestHelper.totalBytesWritten / 1024 / 1024;
double currentBytesDownloaded = (double)downloadTaskTestHelper.totalBytesWritten / 1024 / 1024;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.f

floating point arithmetic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(float) / (integral) => float #WontFix

currentBytesDownloaded = (double)downloadTaskTestHelper.totalBytesWritten / 1024 / 1024;
ASSERT_EQ_MSG(currentBytesDownloaded, lastBytesDownloaded, "FAILED: File download should have stopped!");
ASSERT_EQ(NSURLSessionTaskStateCanceling, downloadTask.state);
lastBytesDownloaded = (double)downloadTaskTestHelper.totalBytesWritten / 1024 / 1024;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor

@msft-Jeyaram msft-Jeyaram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 cake

@@ -673,14 +670,12 @@ inline int _GetLastDelegateCall(NSURLSessionDownloadTaskTestHelper* downloadTask
[conditionCancelled unlock];

// Make sure download has stopped.
lastBytesDownloaded = (double)downloadTaskTestHelper.totalBytesWritten / 1024 / 1024;
[NSThread sleepForTimeInterval:0.5];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PLEASE PLEASE PLEASE NO.

This is NOT a good way to test this sort of thing. These tests should honestly be scrapped and rewritten using events / mocks / something so we aren't guessing on when it will complete. It just slows down things for everyone and only adds minimal more reliability because they still hit real endpoints that could take arbitrary time to respond ....

@bbowman
Copy link
Member

bbowman commented Jan 20, 2017

🕐

Copy link

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, switching my status to reject. Let's disable this test to unblock automated testing and revisit #1737.

@aballway aballway changed the title Make NSURLSession test more lenient and have clearer failure messages Disable NSURLSession DownloadTaskWithURL_WithCancelResume test Jan 20, 2017
@DHowett-MSFT
Copy link

@bbowman Would you mind taking a look now that this disables the test?
We'll keep #1737 open to track the bug fix.

@DHowett-MSFT DHowett-MSFT merged commit 07a9631 into microsoft:develop Jan 20, 2017
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.

5 participants