mozilla / cubeb

Cross platform audio library
ISC License
439 stars 124 forks source link

audiounit: test_record is flaky #308

Open djg opened 7 years ago

djg commented 7 years ago

Seeing failure followed by success on two consecutive runs:

djg in ~/Mozilla/cubeb/build on remove-device-collection! [2] $ ./test_record ⤬ Running main() from gtest_main.cc [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from cubeb [ RUN ] cubeb.record stream started stream stopped /Users/djg/Mozilla/cubeb/test/test_record.cpp:112: Failure Value of: stream_state.seen_audio Actual: false Expected: true [ FAILED ] cubeb.record (574 ms) [----------] 1 test from cubeb (574 ms total)

[----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (574 ms total) [ PASSED ] 0 tests. [ FAILED ] 1 test, listed below: [ FAILED ] cubeb.record

1 FAILED TEST

djg in ~/Mozilla/cubeb/build on remove-device-collection! [1] $ ./test_record ⤬ Running main() from gtest_main.cc [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from cubeb [ RUN ] cubeb.record stream started stream stopped [ OK ] cubeb.record (573 ms) [----------] 1 test from cubeb (573 ms total)

[----------] Global test environment tear-down [==========] 1 test from 1 test case ran. (573 ms total) [ PASSED ] 1 test.

kinetiknz commented 7 years ago

The test relies on sound capture from the mic (yes, this is pretty awful for an automated test), so you need to make noise when the test runs. The ambient noise generally isn't enough, especially on macOS where noise reduction is enabled on the internal mic by default.

djg commented 7 years ago

Close as "Will not fix"?

kinetiknz commented 7 years ago

I don't think so. The test should be fixed to avoid relying on user interaction. The automated tests should all be able to be run unattended.

It's possible there are various scenarios that are infeasible to test with automation, but we should create a new test suite for all tests that expect user interaction to complete.