On Wed, 25 Mar 2026 03:37:06 GMT, Renjith Kannath Pariyangad <[email protected]> wrote:
>> It looks like most of the DISPOSE_ON_CLOSE usages in tests were added >> recently. It is better not to use it since in some cases it allows bypassing >> the test logic and make the test green. I also recall that at some point >> several tests were cleaned up to remove it. > > Thanks @mrserb for your suggestion, I have removed this line > It is better not to use it since in some cases it allows bypassing the test > logic and make the test green. @mrserb Can you elaborate how `DISPOSE_ON_CLOSE` allows bypassing the test logic? The only reason why it was here is to allow visual inspection (even though I don't think it would ever be necessary in this test) and to be able to cleanly exit the test rather than killing the java process. Any interaction while an automatic test is running invalidates the test results. So, I'm trying to understand your concern… > I also recall that at some point several tests were cleaned up to remove it. I've never come across removal of any `setDefaultCloseOperation`. Although I always ask to replace `EXIT_ON_CLOSE` with `DISPOSE_ON_CLOSE` because jtreg tests aren't supposed to call `System.exit`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30184#discussion_r2988006834
