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

Add download tests for remaining datasets #3338

Merged
merged 27 commits into from
Feb 3, 2021

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Feb 2, 2021

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.

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

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

LGTM.

@pmeier pmeier force-pushed the download-tests-kmnist branch from 5b8c3a6 to c8f54c4 Compare February 2, 2021 13:35
@pmeier pmeier changed the title Add download tests for KMNIST Add download tests for remaining datasets Feb 2, 2021
@pmeier
Copy link
Collaborator Author

pmeier commented Feb 2, 2021

The three failing URLs

are working fine. Either re-run the download tests or accept them as fluke an merge this 😉

@pmeier pmeier requested a review from datumbox February 2, 2021 13:54
@datumbox
Copy link
Contributor

datumbox commented Feb 2, 2021

@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.

@pmeier
Copy link
Collaborator Author

pmeier commented Feb 2, 2021

@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.

@pmeier
Copy link
Collaborator Author

pmeier commented Feb 2, 2021

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.

Copy link
Contributor

@datumbox datumbox left a 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)
Copy link
Contributor

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:
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.

@datumbox datumbox merged commit c5d6f1f into pytorch:master Feb 3, 2021
@pmeier pmeier deleted the download-tests-kmnist branch February 3, 2021 14:08
@pmeier pmeier mentioned this pull request Feb 3, 2021
facebook-github-bot pushed a commit that referenced this pull request Feb 4, 2021
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants