RFR: 8213269: convert test/hotspot/jtreg/runtime/memory/RunUnitTestsConcurrently to gtest
Mikhailo Seledtsov
mseledtsov at openjdk.java.net
Fri Feb 26 03:50:40 UTC 2021
On Fri, 26 Feb 2021 00:37:35 GMT, Igor Ignatyev <iignatyev at openjdk.org> wrote:
>> This is a preliminary review. I would like to get the initial feedback before I proceed with conversion of the remaining tests.
>>
>> Here is what I did so far:
>> - created a UnitTestThread and a main test runner, based on gtests with similar needs
>> - moved the original code from HotSpot internals (so called hotspot internal tests: src/hotspot/share/memory/virtualspace.cpp)
>> to the newly created gtest while wrapping it into a TestReservedSpace class. I did not change the code of the test.
>> - removed invocations from whitebox.cpp
>>
>> Testing:
>> - ran GTestWrapper on usual platforms - All PASS
>> - ensured that ReservedSpaceConcurrent is in the logs and passed
>>
>> After gathering the feedback my plan is:
>> Plan:
>> - move the remaining internal Memory/VirtualSpace tests into a gTest
>> - I am thinking about using separate files for each test
>> - create a common file for UnitTestThread and MultiThreadTestRunner to reuse the code
>
> test/hotspot/gtest/concurrentTestRunner.inline.hpp line 1:
>
>> 1: /*
>
> for c++, we don't use camelCase in filenames, but rather use small_snake_case
OK. I saw gtestMain.cpp, gtestLauncher.cpp and a few others, and just followed that. I also see a number of test_camelCase.cpp: test_primitiveConversions.cpp, test_logSelectionList.cpp and so on. In fact, it seems the most prevalent pattern for gtests is test_camelCase.cpp.
Anyway, no problem, I can rename this file to concurrent_test_runner.inline.hpp
> test/hotspot/gtest/runtime/test_os_windows.cpp line 704:
>
>> 702:
>> 703: TEST_VM(os_windows, reserve_memory_special_concurrent) {
>> 704: ConcurrentTestRunner testRunner(new ReserveMemorySpecialRunnable(), 30, 15000);
>
> a memory leak
I forgot I am not in Java anymore :)
-------------
PR: https://git.openjdk.java.net/jdk/pull/2436
More information about the hotspot-dev
mailing list