Skip to content

Commit 8cabcde

Browse files
committed
Fix StatusTool related issues on Windows (#2798)
- Add missing file permission for tests - Update invalid path filter for Windows (cherry picked from commit 290dba6)
1 parent a15e6f4 commit 8cabcde

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gradle/testing/randomization/policies/solr-tests.policy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,8 @@ grant {
255255

256256
// Run java
257257
permission java.io.FilePermission "${java.home}${/}-", "execute";
258-
permission java.io.FilePermission "C:\\Windows\\*\\wmic.exe", "execute";
258+
// Required by SolrProcessManager on Windows to find Solr processes, used by StatusTool (CLI)
259+
permission java.io.FilePermission "<<ALL FILES>>", "execute";
259260
};
260261

261262
// Grant all permissions to Gradle test runner classes.

solr/core/src/test/org/apache/solr/cli/SolrProcessManagerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private static Pair<Integer, Process> createProcess(int port, boolean https) thr
8585
// Get the path to the java executable from the current JVM
8686
String classPath =
8787
Arrays.stream(System.getProperty("java.class.path").split(File.pathSeparator))
88-
.filter(p -> p.contains("solr/core/build"))
88+
.filter(p -> p.contains("solr") && p.contains("core") && p.contains("build"))
8989
.collect(Collectors.joining(File.pathSeparator));
9090
ProcessBuilder processBuilder =
9191
new ProcessBuilder(

0 commit comments

Comments
 (0)