python-docs-samples icon indicating copy to clipboard operation
python-docs-samples copied to clipboard

speech/cloud-client test failures

Open tmatsuo opened this issue 6 years ago • 7 comments

Builds https://source.cloud.google.com/results/invocations/ee35c95b-7ef9-4c90-b5ca-b30534a5c83b/targets https://source.cloud.google.com/results/invocations/eace6b03-019a-4f2a-9802-4e07135a922d/targets

We don't have xunit xml log file, so build cop bot didn't catch it, but it seems like Python died. Log:

============================= test session starts ==============================
platform linux -- Python 3.7.7, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 -- /workspace/speech/cloud-client/.nox/py-3-7/bin/python
cachedir: .pytest_cache
rootdir: /workspace, configfile: pytest.ini
collecting ... collected 22 items

beta_snippets_test.py::test_transcribe_file_with_enhanced_model PASSED   [  4%]
beta_snippets_test.py::test_transcribe_file_with_metadata PASSED         [  9%]
beta_snippets_test.py::test_transcribe_file_with_auto_punctuation PASSED [ 13%]
beta_snippets_test.py::test_transcribe_diarization PASSED                [ 18%]
beta_snippets_test.py::test_transcribe_multichannel_file E0828 10:27:18.708634490   13111 sync_posix.cc:67]           assertion failed: pthread_mutex_lock(mu) == 0
Fatal Python error: Aborted

Thread 0x00007f2c36e0e600 (most recent call first):
  File "/usr/local/lib/python3.7/codecs.py", line 322 in decode
  File "/workspace/speech/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/_pytest/capture.py", line 484 in snap
  File "/workspace/speech/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/_pytest/capture.py", line 570 in readouterr
  File "/workspace/speech/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/_pytest/capture.py", line 657 in read_global_capture
  File "/workspace/speech/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/_pytest/capture.py", line 718 in item_capture
nox > Command pytest --junitxml=sponge_log.xml failed with exit code -6
nox > Session py-3.7 failed.

tmatsuo avatar Aug 28 '20 18:08 tmatsuo

I think this is due to a flaky test. We can't repro the failure locally.

telpirion avatar Sep 09 '20 19:09 telpirion

Hi @tmatsuo

I ran those tests locally and they're all passing. I went over this and found that this might be caused by some threading issue as Kokoro is running all the tests concurrently or in parallel with different versions of python.

I am receptive to more information abut this issue or how to repro it, if possible.

b-loved-dreamer avatar Sep 09 '20 20:09 b-loved-dreamer

@b-loved-dreamer flaky might help reproducing flaky tests.

pytest.mark.flaky(max_runs=1000, min_passes=1000):
def flaky_test():
    assert(flaky_result)

Did you already try that?

tmatsuo avatar Sep 09 '20 22:09 tmatsuo

@tmatsuo

I was able to reproduce the flaky tests using the flaky plugin. I am submitting a report internally.

b-loved-dreamer avatar Sep 15 '20 15:09 b-loved-dreamer

It's not happening too often, also we created an issue to the upstream. Downgrading to p2. @b-loved-dreamer Do you have a reference to the internal bug?

tmatsuo avatar Sep 25 '20 18:09 tmatsuo

Per conversation over chat, let's close this issue and reopen on python-speech.

telpirion avatar Oct 01 '20 17:10 telpirion

This issue now tracked here: https://github.com/googleapis/python-speech/issues/76

telpirion avatar Oct 01 '20 17:10 telpirion