Skip to content

read_excel tests sporadically fail in CI because some file handles remain open #2559

@vnlitvinov

Description

@vnlitvinov

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux
  • Modin version (modin.__version__): master (e.g. 3e62906)
  • Python version: any
  • Code we can use to reproduce: watch for read_io tests

Describe the problem

Something seems to be reading statistics from time to time, as tests that fail are always having files from /proc/<pid>/<something> left open.

Source code / logs

Example: https://github.com/modin-project/modin/runs/1572578393#step:22:64
_____________________ TestExcel.test_read_excel_index_col ______________________

a = (<modin.pandas.test.test_io.TestExcel object at 0x7f0df11ea9d0>,), kw = {}
fstart = [], leaks = [('/proc/10921/stat', 60)], item = ('/proc/10921/stat', 60)

    @functools.wraps(func)
    def check(*a, **kw):
        fstart = _get_open_files()
        try:
            return func(*a, **kw)
        finally:
            leaks = []
            for item in _get_open_files():
                try:
                    fstart.remove(item)
                except ValueError:
                    leaks.append(item)
            assert (
                not leaks
>           ), f"Unexpected open handles left for: {', '.join(item[0] for item in leaks)}"
E           AssertionError: Unexpected open handles left for: /proc/10921/stat

More info: the check was introduced in #2514

Metadata

Metadata

Assignees

No one assigned

    Labels

    Testing 📈Issues related to testingbug 🦗Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions