You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/05/14 18:38:00 UTC
[GitHub] [incubator-mxnet] zhreshold opened a new pull request #18323: Fix race condition in unittest by mark as serial tests
zhreshold opened a new pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323
## Description ##
Fix #18322
## Checklist ##
### Essentials ###
Please feel free to remove inapplicable items for your PR.
- [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes)
- [ ] Changes are complete (i.e. I finished coding on this PR)
- [ ] All changes have test coverage:
- Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
- Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
- Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
- [ ] Code is well-documented:
- For user-facing API changes, API doc string has been updated.
- For new C++ functions in header files, their functionalities and arguments are documented.
- For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
- Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
- [ ] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
### Changes ###
- [ ] Feature1, tests, (and when applicable, API doc)
- [ ] Feature2, tests, (and when applicable, API doc)
## Comments ##
- If this change is a backward incompatible change, why must this change be made.
- Interesting edge cases to note here
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] leezu commented on pull request #18323: Fix race condition in unittest by mark as serial tests
Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323#issuecomment-628822907
Could you clarify where the race occurs?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] leezu commented on pull request #18323: Fix race condition in unittest by mark as serial tests
Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323#issuecomment-628890535
Would creating the rec-file at a temporary path then solve the issue while preserving parallelization? You can take the `tmp_path` argument in your test function to have pytest provide a temporary directory unique for this test. https://docs.pytest.org/en/latest/tmpdir.html
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #18323: Fix race condition in unittest by mark as serial tests
Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323#issuecomment-628816516
Hey @zhreshold , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:
- To trigger all jobs: @mxnet-bot run ci [all]
- To trigger specific jobs: @mxnet-bot run ci [job1, job2]
***
**CI supported jobs**: [windows-gpu, centos-gpu, sanity, windows-cpu, miscellaneous, unix-cpu, clang, edge, website, unix-gpu, centos-cpu]
***
_Note_:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] leezu merged pull request #18323: Fix race condition in unittest by pytest temp_dir fixtures
Posted by GitBox <gi...@apache.org>.
leezu merged pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] leezu commented on a change in pull request #18323: Fix race condition in unittest by pytest temp_dir fixtures
Posted by GitBox <gi...@apache.org>.
leezu commented on a change in pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323#discussion_r427732782
##########
File path: tests/python/unittest/test_gluon_data.py
##########
@@ -138,52 +137,52 @@ def test_sampler():
assert sorted(sum(list(rand_batch_keep), [])) == list(range(10))
@with_seed()
-def test_datasets():
- assert len(gluon.data.vision.MNIST(root='data/mnist')) == 60000
- assert len(gluon.data.vision.MNIST(root='data/mnist', train=False)) == 10000
- assert len(gluon.data.vision.FashionMNIST(root='data/fashion-mnist')) == 60000
- assert len(gluon.data.vision.FashionMNIST(root='data/fashion-mnist', train=False)) == 10000
- assert len(gluon.data.vision.CIFAR10(root='data/cifar10')) == 50000
- assert len(gluon.data.vision.CIFAR10(root='data/cifar10', train=False)) == 10000
- assert len(gluon.data.vision.CIFAR100(root='data/cifar100')) == 50000
- assert len(gluon.data.vision.CIFAR100(root='data/cifar100', fine_label=True)) == 50000
- assert len(gluon.data.vision.CIFAR100(root='data/cifar100', train=False)) == 10000
+def test_datasets(tmpdir):
+ p = tmpdir.mkdir("test_datasets")
+ assert len(gluon.data.vision.MNIST(root=str(p.join('mnist')))) == 60000
+ assert len(gluon.data.vision.MNIST(root=str(p.join('mnist')), train=False)) == 10000
+ assert len(gluon.data.vision.FashionMNIST(root=str(p.join('fashion-mnist')))) == 60000
+ assert len(gluon.data.vision.FashionMNIST(root=str(p.join('fashion-mnist')), train=False)) == 10000
+ assert len(gluon.data.vision.CIFAR10(root=str(p.join('cifar10')))) == 50000
+ assert len(gluon.data.vision.CIFAR10(root=str(p.join('cifar10')), train=False)) == 10000
+ assert len(gluon.data.vision.CIFAR100(root=str(p.join('cifar100')))) == 50000
+ assert len(gluon.data.vision.CIFAR100(root=str(p.join('cifar100')), fine_label=True)) == 50000
+ assert len(gluon.data.vision.CIFAR100(root=str(p.join('cifar100')), train=False)) == 10000
@with_seed()
-@pytest.mark.serial
-def test_datasets_handles():
- assert len(gluon.data.vision.MNIST(root='data/mnist').__mx_handle__()) == 60000
- assert len(gluon.data.vision.MNIST(root='data/mnist', train=False).__mx_handle__()) == 10000
- assert len(gluon.data.vision.FashionMNIST(root='data/fashion-mnist').__mx_handle__()) == 60000
- assert len(gluon.data.vision.FashionMNIST(root='data/fashion-mnist', train=False).__mx_handle__()) == 10000
- assert len(gluon.data.vision.CIFAR10(root='data/cifar10').__mx_handle__()) == 50000
- assert len(gluon.data.vision.CIFAR10(root='data/cifar10', train=False).__mx_handle__()) == 10000
- assert len(gluon.data.vision.CIFAR100(root='data/cifar100').__mx_handle__()) == 50000
- assert len(gluon.data.vision.CIFAR100(root='data/cifar100', fine_label=True).__mx_handle__()) == 50000
- assert len(gluon.data.vision.CIFAR100(root='data/cifar100', train=False).__mx_handle__()) == 10000
+def test_datasets_handles(tmpdir):
+ p = tmpdir.mkdir("test_datasets_handles")
+ assert len(gluon.data.vision.MNIST(root=str(p.join('mnist'))).__mx_handle__()) == 60000
+ assert len(gluon.data.vision.MNIST(root=str(p.join('mnist')), train=False).__mx_handle__()) == 10000
+ assert len(gluon.data.vision.FashionMNIST(root=str(p.join('fashion-mnist'))).__mx_handle__()) == 60000
+ assert len(gluon.data.vision.FashionMNIST(root=str(p.join('fashion-mnist')), train=False).__mx_handle__()) == 10000
+ assert len(gluon.data.vision.CIFAR10(root=str(p.join('cifar10'))).__mx_handle__()) == 50000
+ assert len(gluon.data.vision.CIFAR10(root=str(p.join('cifar10')), train=False).__mx_handle__()) == 10000
+ assert len(gluon.data.vision.CIFAR100(root=str(p.join('cifar100'))).__mx_handle__()) == 50000
+ assert len(gluon.data.vision.CIFAR100(root=str(p.join('cifar100')), fine_label=True).__mx_handle__()) == 50000
+ assert len(gluon.data.vision.CIFAR100(root=str(p.join('cifar100')), train=False).__mx_handle__()) == 10000
@with_seed()
-def test_image_folder_dataset():
- prepare_record()
- dataset = gluon.data.vision.ImageFolderDataset('data/test_images')
+def test_image_folder_dataset(prepare_record):
+ print(prepare_record[:-8])
Review comment:
https://docs.python.org/3/library/os.path.html#os.path.dirname ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] leezu commented on pull request #18323: Fix race condition in unittest by mark as serial tests
Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323#issuecomment-631151888
@mxnet-bot run ci [centos-cpu, unix-cpu]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] zhreshold commented on pull request #18323: Fix race condition in unittest by mark as serial tests
Posted by GitBox <gi...@apache.org>.
zhreshold commented on pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323#issuecomment-628832894
If multiple tests want to create the rec file at the same time, the rec file may be corrupted
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #18323: Fix race condition in unittest by mark as serial tests
Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #18323:
URL: https://github.com/apache/incubator-mxnet/pull/18323#issuecomment-631151946
Jenkins CI successfully triggered : [centos-cpu, unix-cpu]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org