question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test fails with missing ./tests/resource/sample_feature.hdf file

See original GitHub issue

I run the tests locally and got:

$ python -m pytest
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.6.9, pytest-5.4.3, py-1.10.0, pluggy-0.13.1
rootdir: /home/audeering.local/hwierstorf/tmp/omnizart/omnizart
plugins: mock-3.6.1, cov-2.12.0                   
collected 81 items                                                                                                                                                                            
                                              
tests/test_load_label.py .......                                                                                                                                                        [  8%]
tests/test_utils.py ..................                                                                                                                                                  [ 30%]
tests/beat/test_app.py ..                                                                                                                                                               [ 33%]
tests/chord/test_app.py ...                                                                                                                                                             [ 37%] tests/drum/test_app.py ..                                                                                                                                                               [ 39%]
tests/drum/test_labels.py .                                                                                                                                                             [ 40%]
tests/drum/test_prediction.py ............                                                                                                                                              [ 55%]
tests/feature/test_wrapper_func.py .F                                                                                                                                                   [ 58%]
tests/music/test_app.py ....                                                                                                                                                            [ 62%] 
tests/music/test_inference.py .....                                                                                                                                                     [ 69%] 
tests/music/test_labels.py ........                                                                                                                                                     [ 79%] 
tests/music/test_prediction.py ..........                                                                                                                                               [ 91%]
tests/patch_cnn/test_app.py ..                                                                                                                                                          [ 93%]
tests/vocal/test_app.py ...                                                                                                                                                             [ 97%]
tests/vocal_contour/test_app.py ..                                                                                                                                                      [100%]

========================================================================================== FAILURES ===========================================================================================
___________________________________________________________________________________ test_extract_patch_cqt ____________________________________________________________________________________

mocker = <pytest_mock.plugin.MockerFixture object at 0x7f95824cb0b8>

    def test_extract_patch_cqt(mocker):
>       with h5py.File("./tests/resource/sample_feature.hdf", "r") as fin:

tests/feature/test_wrapper_func.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.6/site-packages/h5py/_hl/files.py:408: in __init__
    swmr=swmr)
.venv/lib/python3.6/site-packages/h5py/_hl/files.py:173: in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
h5py/_objects.pyx:54: in h5py._objects.with_phil.wrapper
    ???
h5py/_objects.pyx:55: in h5py._objects.with_phil.wrapper
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   OSError: Unable to open file (unable to open file: name = './tests/resource/sample_feature.hdf', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

h5py/h5f.pyx:88: OSError
====================================================================================== warnings summary =======================================================================================
.venv/lib/python3.6/site-packages/tensorflow/python/autograph/utils/testing.py:21
  /home/audeering.local/hwierstorf/tmp/omnizart/omnizart/.venv/lib/python3.6/site-packages/tensorflow/python/autograph/utils/testing.py:21: DeprecationWarning: the imp module is deprecated in
 favour of importlib; see the module's documentation for alternative uses
    import imp

.venv/lib/python3.6/site-packages/jsonschema/validators.py:928
tests/test_utils.py::test_serializable_with_schema
tests/test_utils.py::test_serializable_with_schema
tests/music/test_app.py::test_load_model[None]
tests/music/test_app.py::test_load_model[Piano]
tests/music/test_app.py::test_load_model[Stream]
tests/music/test_app.py::test_load_model[Pop]
  /home/audeering.local/hwierstorf/tmp/omnizart/omnizart/.venv/lib/python3.6/site-packages/jsonschema/validators.py:928: DeprecationWarning: The metaschema specified by $schema was not found.
 Using the latest draft to validate, but this will raise an error in the future.
    cls = validator_for(schema)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=================================================================================== short test summary info ===================================================================================
FAILED tests/feature/test_wrapper_func.py::test_extract_patch_cqt - OSError: Unable to open file (unable to open file: name = './tests/resource/sample_feature.hdf', errno = 2, error messag...
===================================================================== 1 failed, 80 passed, 8 warnings in 61.78s (0:01:01) =====================================================================

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
hagenwcommented, Nov 19, 2021

With version 0779fd5699be6605b9944ab3c5013af3c49f65df of the repo the issue is solved for me.

I did run:

$ make install
$ make install-dev
$ source .venv/bin/activate
$ python -m pytest

as proposed in CONTRIBUTING.md and it worked fine for me.

If you like, you can close this issue.

0reactions
BreezeWhitecommented, Oct 14, 2021

@faroit the first issue could be solved by executing the following code:

./scripts/gdrive.sh https://drive.google.com/file/d/10i8z1zH60a2coKEst47lELdkvZUmgd1b/view
unzip resource.zip
mv resource/* tests/resource

For the second issue, could you provide the complete log of where the test failed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xcode fails to discover tests, missing gutter test diamonds
A couple of days ago Xcode stopped loading our tests into the test navigator. Additionally our test class files stopped showing the gutter...
Read more >
Test failure building against hdf5 1.10.0 · Issue #244 - GitHub
I see from the 1.10 release that they are providing a way to retain the 1.8 API (which is good), but I'm wondering...
Read more >
Error in reading hdf file using h5py package for python
I think there could be two possible problems: 1) As the file extension is "hdf", maybe this is a HDF4 file. HDF5 files...
Read more >
2D Output File (HDF5 binary file)
If you want these velocities output to the HDF file you must go to the "Unsteady Flow Analysis" window, then select "Options", then...
Read more >
How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found