google-cloud-python icon indicating copy to clipboard operation
google-cloud-python copied to clipboard

Flaky BigQuery system tests

Open tseaver opened this issue 8 years ago • 29 comments

E.g., see:

https://circleci.com/gh/GoogleCloudPlatform/google-cloud-python/5869

tseaver avatar Mar 07 '18 21:03 tseaver

New flakiness today:

nox > Running session system(py='2.7')
nox > /usr/local/bin/python3.6 -m virtualenv /var/code/gcp/.nox/sys-2-7 -p python2.7
nox > chdir /var/code/gcp/bigquery
nox > pip install --upgrade --pre grpcio
nox > pip install --upgrade mock pytest ../api_core ../core
nox > pip install --upgrade ../storage ../test_utils
nox > pip install --upgrade -e .[pandas]
nox > pip install --upgrade ipython==5.5
nox > py.test --quiet tests/system.py
F...............................................                         [100%]
=================================== FAILURES ===================================
_______________________ TestBigQuery.test_bigquery_magic _______________________

self = <tests.system.TestBigQuery testMethod=test_bigquery_magic>

    @pytest.mark.skipif(pandas is None, reason='Requires `pandas`')
    @pytest.mark.skipif(IPython is None, reason='Requires `ipython`')
    @pytest.mark.usefixtures('ipython_interactive')
    def test_bigquery_magic(self):
        ip = IPython.get_ipython()
>       ip.extension_manager.load_extension('google.cloud.bigquery')
E       AttributeError: 'NoneType' object has no attribute 'extension_manager'

tests/system.py:1805: AttributeError
1 failed, 47 passed in 278.57 seconds

Also fails on 3.7.

tseaver avatar May 29 '18 13:05 tseaver

Interesting that it's even trying to run that on Python 2.7. I believe we want to exclude IPython tests from Python 2.7 because they stopped supporting it in recent versions.

@alixhami Is this the issue you were encountering where two skipif statements weren't actually ANDing together?

Python 3.7 is likely failing due to Pandas missing. https://github.com/GoogleCloudPlatform/google-cloud-python/issues/5294

tswast avatar May 29 '18 15:05 tswast

Possibly will be fixed by https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5387

tswast avatar May 29 '18 15:05 tswast

@tswast I think the problem is that the ipython fixture is not being used for some reason. And I believe he meant 2.7 and 3.6 are failing, because 3.7 doesn't have a system test session yet.

alixhami avatar May 29 '18 16:05 alixhami

I think the problem is that the ipython fixture is not being used for some reason.

@alixhami Ah, yeah that's probably it. I see in #5387 that you use @unittest.skipIf(pandas is None, 'Requires pandas') in the unit tests. I bet the system tests need an update to do the same (rather than use pytest.mark).

tswast avatar May 29 '18 17:05 tswast

Verified locally that upgrading pytest to 3.6.0 causes this failure.

tswast avatar May 29 '18 17:05 tswast

System tests have special logic for 2.7 / IPython:

     # IPython does not support Python 2 after version 5.x
     if session.interpreter == 'python2.7':
         session.install('ipython==5.5')
     else:
         session.install('ipython')

tseaver avatar May 29 '18 17:05 tseaver

BigQuery system tests are now passing again: https://circleci.com/gh/GoogleCloudPlatform/google-cloud-python/6729

tswast avatar May 29 '18 19:05 tswast

I'm closing this one, although we have new flakiness: #5588, #5589

tseaver avatar Jul 11 '18 15:07 tseaver