On Wed, 15 Nov 2023 19:17:14 GMT, Damon Nguyen <dngu...@openjdk.org> wrote:
>> U mean to create a test directory and store image there? > > Not a new test directory. In that referenced PR, I had to get the path to the > directory where test files are stored temporarily. This helps with testing > mainly. > > `Path.of(System.getProperty("test.classes", "."));` was the path I used in > the PR. I saved it to a var and wrote the image to that var followed by the > image name. When run with jtreg, the current directory is the scratch directory which is thrown away if the test passes or stored by the harness if the test fails. It is safe to use it this way, many tests do save images like this. Your case was somewhat different: you creating and saving an image for the test use. I guess it could also do without the extra stuff, however, preserving the generated image if the test fails may be unnecessary. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16374#discussion_r1399394072