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

Tests requiring internet access #1088

Open
adamjstewart opened this issue Feb 5, 2023 · 7 comments
Open

Tests requiring internet access #1088

adamjstewart opened this issue Feb 5, 2023 · 7 comments
Labels
testing Continuous integration testing

Comments

@adamjstewart
Copy link
Collaborator

adamjstewart commented Feb 5, 2023

Description

Several of our tests require internet access. This is problematic for a number of reasons:

  1. The GitHub Actions runners or the upload servers may have internet issues, leading to intermittent failures
  2. Long download times slow down testing (the failing tests I discovered are all in our top 10 slowest tests)

We should apply the same magic we used in previous PRs to monkeypatch any downloads.

Steps to reproduce

  1. Turn off WiFi or unplug the ethernet cable
  2. Delete PyTorch's cached downloads: rm -r $(python -c 'import torch; print(torch.hub.get_dir())')
  3. Run pytest
FAILED tests/models/test_farseg.py::TestFarSeg::test_valid_backbone[resnet18-True] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
FAILED tests/models/test_farseg.py::TestFarSeg::test_valid_backbone[resnet50-True] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
FAILED tests/trainers/test_detection.py::TestObjectDetectionTask::test_trainer[True-faster-rcnn-nasa_marine_debris-NASAMarineDebrisDataModule] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor ser...
FAILED tests/trainers/test_detection.py::TestObjectDetectionTask::test_trainer[True-fcos-nasa_marine_debris-NASAMarineDebrisDataModule] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname p...
FAILED tests/trainers/test_detection.py::TestObjectDetectionTask::test_trainer[True-retinanet-nasa_marine_debris-NASAMarineDebrisDataModule] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servn...
FAILED tests/trainers/test_detection.py::TestObjectDetectionTask::test_no_rgb[True] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
FAILED tests/trainers/test_detection.py::TestObjectDetectionTask::test_predict[True] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>

Version

0.5.0.dev0 (ce4e7ef)

@adamjstewart adamjstewart added the testing Continuous integration testing label Feb 5, 2023
@adamjstewart
Copy link
Collaborator Author

Bonus points if anyone can figure out how to jail our runners so that we can actually test this in CI and prevent it from slipping in again. We seem to fix bugs like this with every release.

Note that many of our slow tests (run only on release branches) are actually designed to test these kinds of dataset and weight downloads. We should be able to get 100% coverage without internet access, but can add additional slow tests to ensure that the weights still download correctly.

@adamjstewart
Copy link
Collaborator Author

Related to #194 (fixed in #265) and #495 (fixed in #497)

@adamjstewart
Copy link
Collaborator Author

@calebrob6 I think the detection tests could use the same treatment from #344, that would greatly speed things up.

@adamjstewart adamjstewart added this to the 0.4.1 milestone Feb 21, 2023
@calebrob6
Copy link
Member

calebrob6 commented Feb 26, 2023

Do you want to add that as an issue so we don't lose track of it, or should we just do it now? I guess we can just leave this open?

@adamjstewart
Copy link
Collaborator Author

It can be done at the same time, using a fake detection model and avoiding downloads. Both will speed up the test and make it more stable.

@calebrob6 calebrob6 modified the milestones: 0.4.1, 0.4.2 Apr 10, 2023
@adamjstewart
Copy link
Collaborator Author

adamjstewart commented May 1, 2023

FarSeg tests were failing on main because of this. Would love to get these fixed.

@adamjstewart adamjstewart removed this from the 0.4.2 milestone Sep 28, 2023
@adamjstewart
Copy link
Collaborator Author

Update: slowly whittling these down:

FAILED tests/models/test_farseg.py::TestFarSeg::test_valid_backbone[resnet18-True] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
FAILED tests/models/test_farseg.py::TestFarSeg::test_valid_backbone[resnet50-True] - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
FAILED tests/trainers/test_detection.py::TestObjectDetectionTask::test_pretrained_backbone - urllib.error.URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Continuous integration testing
Projects
None yet
Development

No branches or pull requests

2 participants