-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Add download tests for remaining datasets #3338
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
5b8c3a6
to
c8f54c4
Compare
The three failing URLs
are working fine. Either re-run the download tests or accept them as fluke an merge this 😉 |
@pmeier There are still a few failures. I think it's important to see them passing and address any flakiness before merging. Let me know what you think. |
@datumbox The failing URLs reported in the test are the ones from my last comment; they are working. IMO this was just a fluke. Lets see what the new CI run brings. |
So, I was wrong. The request indeed timed out. I've added some logic to better capture timeouts. As for the reason why these tests times out: I'm not sure yet. I cannot produce the timeout locally. |
…load-tests-kmnist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I left a few non-blocking nits that can be addressed on future PRs.
except HTTPError as error: | ||
raise AssertionError(f"The server returned {error.code}: {error.reason}.") from error | ||
|
||
|
||
def assert_url_is_accessible(url): | ||
request = Request(url, headers=dict(method="HEAD")) | ||
with assert_server_response_ok(): | ||
urlopen(request) | ||
urlopen(request, timeout=5.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Replace hardcode numeric values with a constant.
|
||
|
||
def assert_file_downloads_correctly(url, md5): | ||
with get_tmp_dir() as root: | ||
file = path.join(root, path.basename(url)) | ||
with assert_server_response_ok(): | ||
with urlopen(url) as response, open(file, "wb") as fh: | ||
with urlopen(url, timeout=5.0) as response, open(file, "wb") as fh: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
Summary: * kmnist * emnist * qmnist * omniglot * phototour * sbdataset * sbu * semeion * stl10 * svhn * usps * cifar100 * enable download logging for google drive * celeba * widerface * lint * add timeout logic * lint * debug CI connection to problematic server * set timeout for ping * [ci skip] remove ping * revert debugging * disable requests to problematic server * re-enable all other tests Reviewed By: datumbox Differential Revision: D26226602 fbshipit-source-id: f2e961205f6dc20fe87c91b2d3a6c07fbad3bf8e Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
This adds the remaining download tests for
KMNIST
EMNIST
QMNIST
Omniglot
Phototour
SBDataset
SBU
SEMEION
STL10
SVHN
USPS
CelebA
WIDERFace
and fixes the test for
CIFAR100
.