-
Notifications
You must be signed in to change notification settings - Fork 361
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
2024.3.1: pytest fails in 5 fsspec/implementations/tests/test_dbfs.py::test_dbfs*
units
#1572
Comments
The DBFS tests use HTTP mocking to work. That should be OK when there is no network, but apparently there is something amiss. I'd be happy to simply skip these tests in such a situation; do you happen to have an idea of how to best detect from within the python test module that HTTP is likely to fail? |
I've tested that on the box with full access to public network and fails are exactly the same. |
Thanks for looking into it, @kloczek ; I'll try to figure out what's going on. |
If you have a moment: can you please check if the YAML files fsspec/implementations/tests/cassettes/test_dbfs/test_dbfs*.yaml exist in the test install? |
In case of your module on packaging I'm using tar ball autogenerated from git tag in which those yaml files are included.. |
#1611 discussed removing test files (this was an artefact of moving the build system to hatch) |
Easiest way to do that separation is move all to tests/ |
Just tested 2024.6.0 and looks like pytest is OK now with few warnigs Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-fsspec-2024.6.0-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-fsspec-2024.6.0-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.2.1, pluggy-1.5.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/filesystem_spec-2024.6.0
configfile: pyproject.toml
plugins: hypothesis-6.100.0, mock-3.14.0, examples-0.0.10, benchmark-4.0.0, Faker-25.3.0, vcr-1.0.2, asyncio-0.23.7
asyncio: mode=strict
collected 1701 items / 9 skipped
fsspec/implementations/tests/local/local_test.py .................................................................................................................................... [ 7%]
... [ 7%]
fsspec/implementations/tests/memory/memory_test.py .................................................................................................................................. [ 15%]
..... [ 15%]
fsspec/implementations/tests/test_archive.py .....................................................................................sssssssssssssssss [ 21%]
fsspec/implementations/tests/test_cached.py ..........................................ssssssssssss............................... [ 26%]
fsspec/implementations/tests/test_common.py ssss [ 27%]
fsspec/implementations/tests/test_data.py .. [ 27%]
fsspec/implementations/tests/test_dirfs.py ........................................................................................................................... [ 34%]
fsspec/implementations/tests/test_ftp.py ............. [ 35%]
fsspec/implementations/tests/test_http.py ....................................................... [ 38%]
fsspec/implementations/tests/test_libarchive.py s [ 38%]
fsspec/implementations/tests/test_local.py .s.........................................................................................ss........ss.sssss.......sss....s.............. [ 46%]
............ [ 47%]
fsspec/implementations/tests/test_memory.py .............................. [ 49%]
fsspec/implementations/tests/test_reference.py .................s.....ss..s [ 50%]
fsspec/implementations/tests/test_sftp.py ssssssssssss [ 51%]
fsspec/implementations/tests/test_tar.py ......................... [ 52%]
fsspec/implementations/tests/test_webhdfs.py sssssssssss [ 53%]
fsspec/implementations/tests/test_zip.py ......... [ 54%]
fsspec/tests/test_api.py ...............x...... [ 55%]
fsspec/tests/test_async.py .........s... [ 56%]
fsspec/tests/test_caches.py ................................................................................................................................................. [ 64%]
fsspec/tests/test_callbacks.py ........ [ 65%]
fsspec/tests/test_compression.py .....s [ 65%]
fsspec/tests/test_config.py ....... [ 65%]
fsspec/tests/test_core.py .................................................s....... [ 69%]
fsspec/tests/test_file.py ........... [ 69%]
fsspec/tests/test_generic.py ...... [ 70%]
fsspec/tests/test_mapping.py ................. [ 71%]
fsspec/tests/test_parquet.py ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 80%]
ssssssssssssssssssssssssssssssssssssssss [ 82%]
fsspec/tests/test_registry.py ......s [ 82%]
fsspec/tests/test_spec.py ....................x...................................................................................................................................... [ 92%]
................................................................. [ 95%]
fsspec/tests/test_utils.py ...................................................................... [100%]
========================================================================================= XFAILURES =========================================================================================
________________________________________________________________________________ test_multilevel_chained_fs _________________________________________________________________________________
@pytest.mark.xfail(reason="see issue #334", strict=True)
def test_multilevel_chained_fs():
"""This test reproduces fsspec/filesystem_spec#334"""
import zipfile
d1 = tempfile.mkdtemp()
f1 = os.path.join(d1, "f1.zip")
with zipfile.ZipFile(f1, mode="w") as z:
# filename, content
z.writestr("foo.txt", "foo.txt")
z.writestr("bar.txt", "bar.txt")
# We expected this to be the correct syntax
> with pytest.raises(IsADirectoryError):
E Failed: DID NOT RAISE <class 'IsADirectoryError'>
fsspec/tests/test_api.py:252: Failed
_________________________________________________________________________________________ test_find _________________________________________________________________________________________
@pytest.mark.xfail
def test_find():
"""Test .find() method on debian server (ftp, https) with constant folder"""
filesystem, host, test_path = (
FTPFileSystem,
"ftp.fau.de",
"ftp://ftp.fau.de/debian-cd/current/amd64/log/success",
)
test_fs = filesystem(host)
filenames_ftp = test_fs.find(test_path)
> assert filenames_ftp
E assert []
fsspec/tests/test_spec.py:699: AssertionError
===================================================================================== warnings summary ======================================================================================
fsspec/tests/test_async.py::test_run_coros_in_chunks
/home/tkloczko/rpmbuild/BUILD/filesystem_spec-2024.6.0/fsspec/asyn.py:267: RuntimeWarning: coroutine 'test_run_coros_in_chunks.<locals>.runner' was never awaited
done, pending = await asyncio.wait(pending, return_when=asyncio.FIRST_COMPLETED)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
fsspec/tests/test_caches.py::test_cache_getitem[background]
/usr/lib64/python3.10/concurrent/futures/thread.py:151: RuntimeWarning: coroutine 'test_run_coros_in_chunks.<locals>.runner' was never awaited
self._idle_semaphore = threading.Semaphore(0)
Enable tracemalloc to get traceback where the object was allocated.
See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ==================================================================================
SKIPPED [1] fsspec/implementations/tests/test_arrow.py:5: could not import 'pyarrow.fs': No module named 'pyarrow'
SKIPPED [1] fsspec/implementations/tests/test_dask.py:5: could not import 'distributed': No module named 'distributed'
SKIPPED [1] fsspec/implementations/tests/test_dbfs.py:33: These tests need to be re-recorded.
SKIPPED [1] fsspec/implementations/tests/test_git.py:11: could not import 'pygit2': No module named 'pygit2'
SKIPPED [1] fsspec/implementations/tests/test_jupyter.py:10: could not import 'notebook': No module named 'notebook'
SKIPPED [1] fsspec/implementations/tests/test_smb.py:15: could not import 'smbprotocol': No module named 'smbprotocol'
SKIPPED [1] fsspec/tests/test_downstream.py:3: could not import 's3fs': No module named 's3fs'
SKIPPED [1] fsspec/tests/test_fuse.py:9: could not import 'fuse': No module named 'fuse'
SKIPPED [1] fsspec/tests/test_gui.py:3: could not import 'panel': No module named 'panel'
SKIPPED [18] fsspec/implementations/tests/test_archive.py:45: could not import 'libarchive': No module named 'libarchive'
SKIPPED [6] fsspec/implementations/tests/test_cached.py:874: could not import 'pyarrow.fs': No module named 'pyarrow'
SKIPPED [6] fsspec/implementations/tests/test_cached.py:888: could not import 'pyarrow.fs': No module named 'pyarrow'
SKIPPED [1] fsspec/implementations/tests/test_common.py:10: could not import 'pyarrow.fs': No module named 'pyarrow'
SKIPPED [3] fsspec/implementations/tests/test_common.py:21: could not import 'pyarrow.fs': No module named 'pyarrow'
SKIPPED [1] fsspec/implementations/tests/test_local.py:135: could not import 's3fs': No module named 's3fs'
SKIPPED [2] fsspec/implementations/tests/test_local.py:785: Windows only
SKIPPED [2] fsspec/implementations/tests/test_local.py:801: Windows only
SKIPPED [5] fsspec/implementations/tests/test_local.py:823: Windows only
SKIPPED [3] fsspec/implementations/tests/test_local.py:880: Windows only
SKIPPED [1] fsspec/implementations/tests/test_local.py:895: Windows only
SKIPPED [1] fsspec/implementations/tests/test_reference.py:433: could not import 'zarr': No module named 'zarr'
SKIPPED [1] fsspec/implementations/tests/test_reference.py:579: could not import 'fastparquet': No module named 'fastparquet'
SKIPPED [1] fsspec/implementations/tests/test_reference.py:625: could not import 'fastparquet': No module named 'fastparquet'
SKIPPED [1] fsspec/implementations/tests/test_reference.py:733: could not import 'zarr': No module named 'zarr'
SKIPPED [1] fsspec/implementations/tests/test_sftp.py:71: docker run not available
SKIPPED [2] fsspec/implementations/tests/test_sftp.py:86: docker run not available
SKIPPED [2] fsspec/implementations/tests/test_sftp.py:104: docker run not available
SKIPPED [1] fsspec/implementations/tests/test_sftp.py:143: docker run not available
SKIPPED [1] fsspec/implementations/tests/test_sftp.py:152: docker run not available
SKIPPED [1] fsspec/implementations/tests/test_sftp.py:183: docker run not available
SKIPPED [2] fsspec/implementations/tests/test_sftp.py:205: docker run not available
SKIPPED [2] fsspec/implementations/tests/test_sftp.py:222: docker run not available
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:43: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:49: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:57: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:67: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:84: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:100: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:121: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:140: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:153: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:163: htcluster not found
SKIPPED [1] fsspec/implementations/tests/test_webhdfs.py:177: htcluster not found
SKIPPED [1] fsspec/tests/test_async.py:134: only for windows
SKIPPED [1] fsspec/tests/test_compression.py:134: could not import 'snappy': No module named 'snappy'
SKIPPED [1] fsspec/tests/test_core.py:357: could not import 's3fs': No module named 's3fs'
SKIPPED [64] fsspec/tests/test_parquet.py:37: fastparquet not found
SKIPPED [64] fsspec/tests/test_parquet.py:37: pyarrow not found
SKIPPED [64] fsspec/tests/test_parquet.py:37: No parquet engine (fastparquet or pyarrow) found
SKIPPED [1] fsspec/tests/test_registry.py:129: could not import 's3fs': No module named 's3fs'
XFAIL fsspec/tests/test_api.py::test_multilevel_chained_fs - see issue #334
XFAIL fsspec/tests/test_spec.py::test_find
============================================================ 1428 passed, 280 skipped, 2 xfailed, 2 warnings in 91.23s (0:01:31) ============================================================
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-87593477-5596-402e-a1d6-2cb0ce4b0bf0/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-87593477-5596-402e-a1d6-2cb0ce4b0bf0/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-87593477-5596-402e-a1d6-2cb0ce4b0bf0/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-87593477-5596-402e-a1d6-2cb0ce4b0bf0/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
warnings.warn(
/usr/lib/python3.10/site-packages/_pytest/pathlib.py:98: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-87593477-5596-402e-a1d6-2cb0ce4b0bf0
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-87593477-5596-402e-a1d6-2cb0ce4b0bf0'
warnings.warn( |
OK, weird :) |
I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesinstaller
modulecut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
List of installed modules in build env:
Please let me know if you need more details or want me to perform some diagnostics.
The text was updated successfully, but these errors were encountered: