|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
@@ -444,16 +444,21 @@ public static void test5() {
|
444 | 444 | Assert.assertEquals(0, count, "Extra processes in descendants");
|
445 | 445 | }
|
446 | 446 |
|
| 447 | + List<ProcessHandle> subprocesses = getChildren(p1Handle); |
| 448 | + printf(" children: %s%n", |
| 449 | + subprocesses.stream().map(p -> p.pid()) |
| 450 | + .collect(Collectors.toList())); |
| 451 | + |
447 | 452 | Assert.assertEquals(getChildren(p1Handle).size(),
|
448 | 453 | factor, "expected direct children");
|
449 | 454 | count = getDescendants(p1Handle).size();
|
450 | 455 | long totalChildren = factor * factor * factor + factor * factor + factor;
|
451 | 456 | Assert.assertTrue(count >= totalChildren,
|
452 | 457 | "expected at least " + totalChildren + ", actual: " + count);
|
453 | 458 |
|
454 |
| - List<ProcessHandle> subprocesses = getDescendants(p1Handle); |
| 459 | + List<ProcessHandle> descSubprocesses = getDescendants(p1Handle); |
455 | 460 | printf(" descendants: %s%n",
|
456 |
| - subprocesses.stream().map(p -> p.pid()) |
| 461 | + descSubprocesses.stream().map(p -> p.pid()) |
457 | 462 | .collect(Collectors.toList()));
|
458 | 463 |
|
459 | 464 | p1.getOutputStream().close(); // Close stdin for the controlling p1
|
|
0 commit comments