RFR: 8310355: Move the stub test from initialize_final_stubs() to test/hotspot/gtest
Mikhailo Seledtsov
mseledtsov at openjdk.org
Mon Jul 17 17:18:12 UTC 2023
On Tue, 4 Jul 2023 04:45:31 GMT, Hao Sun <haosun at openjdk.org> wrote:
> Three groups of runtime routines, i.e. arraycopy, copy and fill, are tested inside function `initialize_final_stubs()`. The test runs every time the debug VM is started.
>
> I think it's a usual convention that it's better not to run functional tests on startup. Hence, this patch proposes to move the stub test under `test/hotspot/gtest`.
>
> It's one copy-paste patch, except the following two minor changes:
>
> 1) Remove `ASSERT` condition check, and the gtest case will be run for release build as well.
>
> 2) Use the gtest helper `ASSERT_TRUE()` to replace the `assert()`.
>
> Note that the downside is that we won't catch stub implementation errors immediately on startup.
>
> Test:
>
> 1) Cross compilations on arm32/s390/ppc/riscv passed.
>
> 2) tier1 test passed on Linux/AArch64, Linux/x86_64 and macOS/Apple silicon. Note that hotspot/gtest is run in tier1.
>
> 3) VM builds with several different options (e.g., zero build, release build, fastdebug build, client variant, no C1/c2) passed on Linux/AArch64 and Linux/x86_64.
>
> 4) I manually injected errors in arraycopy/copy/fill stubs and verified `make test TEST="gtest:StubRoutines"` fails or not. But this check only worked for array fill stub. For the remaining two stubs, VM build (`make images`) failed firstly before running the gtest, because the built VM with these "erroneous" stubs were executed to do something such as loading Java core library code.
Marked as reviewed by mseledtsov (Committer).
Changes look good to me. Thank you for doing this change.
-------------
PR Review: https://git.openjdk.org/jdk/pull/14765#pullrequestreview-1533291249
PR Comment: https://git.openjdk.org/jdk/pull/14765#issuecomment-1638553998
More information about the hotspot-dev
mailing list