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

File leaks during read_csv and read_fwf tests on Windows platform #2533

Open
amyskov opened this issue Dec 14, 2020 · 1 comment
Open

File leaks during read_csv and read_fwf tests on Windows platform #2533

amyskov opened this issue Dec 14, 2020 · 1 comment
Labels
bug 🦗 Something isn't working CI P3 Very minor bugs, or features we can hopefully add some day. Testing 📈 Issues related to testing

Comments

@amyskov
Copy link
Contributor

amyskov commented Dec 14, 2020

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
  • Modin version: 1a8cd0a + patch (listed below)
  • Python version: 3.8.6
  • Code we can use to reproduce:
    patch:
diff --git a/modin/pandas/test/test_io.py b/modin/pandas/test/test_io.py
index 9342980..db14fc6 100644
--- a/modin/pandas/test/test_io.py
+++ b/modin/pandas/test/test_io.py
@@ -309,7 +309,7 @@ def make_csv_file():
             try:
                 os.remove(filename)
             except PermissionError:
-                pass
+                raise


 @pytest.fixture(scope="class")
@@ -357,7 +357,7 @@ def TestReadCSVFixture():
             try:
                 os.remove(filename)
             except PermissionError:
-                pass
+                raise


 def setup_json_file(row_size, force=False):
@@ -420,7 +420,7 @@ def teardown_excel_file():
         try:
             os.remove(TEST_EXCEL_FILENAME)
         except PermissionError:
-            pass
+            raise


 def setup_feather_file(row_size, force=False):
@@ -555,7 +555,7 @@ def teardown_fwf_file():
         try:
             os.remove(TEST_FWF_FILENAME)
         except PermissionError:
-            pass
+            raise


 @pytest.mark.usefixtures("TestReadCSVFixture")
@@ -2305,7 +2305,7 @@ def test_cleanup():
             try:
                 os.remove(f)
             except PermissionError:
-                pass
+                raise


 def test_from_arrow():

After patch applying run pytest modin/pandas/test/test_io.py

Describe the problem

Looks like files are not properly closed as it was in #2514.

Source code / logs

pytest logs:

========================================================================= short test summary info =========================================================================
FAILED modin/pandas/test/test_io.py::test_fwf_file_index_col - PermissionError: [WinError 32] The process cannot access the file because it is being used by another proc...
ERROR modin/pandas/test/test_io.py::TestReadCSV::test_read_csv_internal[None-True-True-True-,-python-False] - PermissionError: [WinError 32] The process cannot access th...
ERROR modin/pandas/test/test_io.py::TestReadCSV::test_read_csv_internal[None-True-True-False-,-python-False] - PermissionError: [WinError 32] The process cannot access t...
======================================= 1 failed, 1577 passed, 12 skipped, 98 xfailed, 3 xpassed, 1693 warnings, 2 errors in 49.04s =======================================
@amyskov amyskov added the bug 🦗 Something isn't working label Dec 14, 2020
@pyrito pyrito added Testing 📈 Issues related to testing CI P3 Very minor bugs, or features we can hopefully add some day. labels Aug 22, 2022
@jbrockmendel
Copy link
Collaborator

possibly useful: pandas.util._test_decorators.check_file_leaks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🦗 Something isn't working CI P3 Very minor bugs, or features we can hopefully add some day. Testing 📈 Issues related to testing
Projects
None yet
Development

No branches or pull requests

3 participants