On Wed, 28 Sep 2022 08:07:25 GMT, Alan Bateman <al...@openjdk.org> wrote:
> This is a test only change to split the execution of some of the larger tests > for virtual threads and reduce the execution time of a few others. > > The tests StructuredTaskScopeTest, ThreadFockTest and > ThreadPerTaskExecutorTest contain a lot of tests and run with thread > factories for both platform and virtual threads. These tests are changed to > run twice, one with the thread factory for platform threads, the other for > virtual threads. This allows the tests to run concurrently. A number of > sleeps/delays in these tests are adjusted. StructuredTaskScopeTest goes from > ~50s to two runs of ~15s. ThreadFockTest goes from 39s to two runs of 15s, > ThreadPerTaskExecutorTest goes from 21s to two runs of 8.5. There is more > that could be done but these tests are likely to change a bit the APIs evolve > so it may not be worth doing now. > > ThreadAPI also contains a lot of tests. A number of tests sleep to give time > for a virtual thread to park or block. These sleeps are replaced with a poll > of the thread state. A number of other tests are changed to use shorter > sleeps. There are a few cleanups that include introducing a number of data > providers and using a STPE for delayed actions. Its execution time goes from > ~31s to ~12s. > > CloseTest has two tests that sleep 1s and they are run with a data provider > that produces six inputs so the sleep time adds up. These lengthy delays > aren't needed for testing > > Finally, some of the stress changes have been changed. The two runs of > PingPong are changed so they are in separate @test descriptions and the > iteration count on a few tests has been reduced for release builds - the > iteration count for debug builds is not changed. This pull request has now been integrated. Changeset: b8f9a915 Author: Alan Bateman <al...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/b8f9a915a2bfd0f7920ecfc5b3a08670df5f9f3e Stats: 459 lines in 11 files changed: 162 ins; 96 del; 201 mod 8293940: Some tests for virtual threads take too long Reviewed-by: dfuchs ------------- PR: https://git.openjdk.org/jdk/pull/10463