RFR: 8282463: javax/sound/sampled/Clip/DataPusherThreadCheck.java fails
Phil Race
prr at openjdk.org
Wed Oct 26 19:43:54 UTC 2022
On Sat, 15 Oct 2022 13:03:26 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
> Test failed on Ubuntu, because both implementations of `MixerProvider` have no devices:
> 1. com.sun.media.sound.DirectAudioDeviceProvider#nGetNumDevices returns `0`
> 
> 2. com.sun.media.sound.PortMixerProvider#nGetNumDevices returns `0`
> 
>
>
> It leads to `javax.sound.sampled.spi.MixerProvider#getMixerInfo` returns empty array.
> 
>
> And DataPusher thread is not created, because of AudioSystem.isLineSupported returns false in the method `com.sun.media.sound.JavaSoundAudioClip#createSourceDataLine`.
> I propose to perform the same check in test code and skip it.
So I have no real objection to this check because it will solve something - more on that at the end.
1) On my Ubuntu 22.04 system it passes this new condition you added - ie the device is present.
2) This test has been failing only very intermittently, which points to the failure mode in the test being that the DataPusher thread is created but is terminated before it can be observed.
Where I've seen the device not present is when running on some VM configs where there is no audio support - there the test will fail every time.
For that I think your check should cure the 100% failure, but will do nothing about the 1% (or less) failure.
That said .. the test doesn't call clip.stop() until after the verification, so perhaps there's something else going on.
-------------
PR: https://git.openjdk.org/jdk/pull/10717
More information about the client-libs-dev
mailing list