RFR: 8353332: Test jdk/jshell/ToolProviderTest.java failed in relation to enable-preview
Jaikiran Pai
jpai at openjdk.org
Mon Apr 7 16:23:03 UTC 2025
On Mon, 7 Apr 2025 15:44:35 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> JShell keeps persisted preferences in `java.util.prefs.Preferences`. But, during tests, an empty persistence is typically used, to avoid values persisted on the test machine to affect the test.
>
> But, in case of `jdk/jshell/ToolProviderTest.java`, this is not done, as JShell is started using the `Tool` interface.
>
> This patch strives to fix that, by adding indirection in building JShell in `JShellToolProvider`, and using that in the test to inject empty persistence.
>
> Thanks to @jaikiran for figuring out the probable cause.
I don't have knowledge of this area, but given what seems to be happening in this test and the code that I looked through briefly, this proposed change to provide a way for augmenting the building of the `JshellTool` seems reasonable to me.
I'll update the JBS issue once the CI runs that I've triggered (without this change) come back. That should tell us if local stored preferences is (the only thing) that's playing a role in these failures.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24492#issuecomment-2783916202
More information about the kulla-dev
mailing list