Skip to content

Flakey Test in CI - Unclosed File Handle #29514

@alimcmaster1

Description

@alimcmaster1

Seen this in a few pipelines today:

https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=20521
https://github.com/pandas-dev/pandas/runs/295247988

______________ test_chunks_have_consistent_numerical_type[python] ______________
[gw0] linux -- Python 3.6.1 /home/vsts/miniconda3/envs/pandas-dev/bin/python

all_parsers = <pandas.tests.io.parser.conftest.PythonParser object at 0x7f635d65e470>

    def test_chunks_have_consistent_numerical_type(all_parsers):
        parser = all_parsers
        integers = [str(i) for i in range(499999)]
        data = "a\n" + "\n".join(integers + ["1.0", "2.0"] + integers)
    
        # Coercions should work without warnings.
        with tm.assert_produces_warning(None):
>           result = parser.read_csv(StringIO(data))

pandas/tests/io/parser/test_common.py:1204: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <contextlib._GeneratorContextManager object at 0x7f631f91c8d0>
type = None, value = None, traceback = None

    def __exit__(self, type, value, traceback):
        if type is None:
            try:
>               next(self.gen)
E               AssertionError: Caused unexpected warning(s): [('ResourceWarning', ResourceWarning("unclosed file <_io.BufferedReader name='test1.xlsx'>",), 

Metadata

Metadata

Assignees

No one assigned

    Labels

    CIContinuous IntegrationUnreliable TestUnit tests that occasionally fail

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions