It would be useful to try and clarify the following issues to make it easier for others when writing jtreg tests as these were a couple of issues that I recently encountered and took me a while to figure out why the tests were failing
- Document perhaps more prominently that if you run jtreg tests via the JDK make files (i.e make run-test), it uses agentvm mode vs the command line which uses othervm mode by default. This can lead to time trying to figure out why tests are running in one environment and failing in another
- When writing tests that use the service-provider loading mechanism or other similar mechanisms, that the tests should specifically be written to use othervm to avoid failures when running in agentvm mode.
- Document perhaps more prominently that if you run jtreg tests via the JDK make files (i.e make run-test), it uses agentvm mode vs the command line which uses othervm mode by default. This can lead to time trying to figure out why tests are running in one environment and failing in another
- When writing tests that use the service-provider loading mechanism or other similar mechanisms, that the tests should specifically be written to use othervm to avoid failures when running in agentvm mode.