Skip to content

Commit 381de0c

Browse files
committed
8266753: jdk/test/lib/process/ProcTest.java failed with "Exception: Proc abnormal end"
Reviewed-by: dfuchs
1 parent 2d2cd78 commit 381de0c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/lib-test/jdk/test/lib/process/ProcTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8265227
26+
* @bug 8265227 8266753
2727
* @summary Test Proc
2828
* @library /test/lib
2929
*/
@@ -36,12 +36,13 @@
3636
public class ProcTest {
3737
public static void main(String[] args) throws Exception {
3838
if (args.length == 0) {
39+
// Test launcher
3940
Proc p1 = Proc.create("ProcTest")
40-
.args("p1")
41+
.args("1")
4142
.debug("p1")
4243
.start();
4344
Proc p2 = Proc.create("ProcTest")
44-
.args("p2")
45+
.args("2")
4546
.debug("p2")
4647
.start();
4748
while (true) {
@@ -54,9 +55,10 @@ public static void main(String[] args) throws Exception {
5455
p1.waitFor();
5556
p2.waitFor();
5657
} else {
58+
// Sub process, args[0] is random seed.
5759
List<String> gestures = List.of("Rock", "Paper", "Scissors");
5860
int wins = 0;
59-
Random r = new Random();
61+
Random r = new Random(Long.parseLong(args[0]));
6062
while (true) {
6163
String my = gestures.get(r.nextInt(3));
6264
Proc.textOut(my); // show first, next line might block

0 commit comments

Comments
 (0)