Skip to content

Commit

Permalink
Stop all sub processes spawn by acceptance tests (#8226)
Browse files Browse the repository at this point in the history
* Stop all sub processes spawn by acceptance tests

Signed-off-by: Fabio Di Fabio <[email protected]>

* Split long running test in 3 parts

Signed-off-by: Fabio Di Fabio <[email protected]>

* Run ATs sequentially

Signed-off-by: Fabio Di Fabio <[email protected]>

---------

Signed-off-by: Fabio Di Fabio <[email protected]>
  • Loading branch information
fab-10 authored Feb 3, 2025
1 parent 24e2895 commit d691f45
Show file tree
Hide file tree
Showing 8 changed files with 362 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
name: test-args-${{ matrix.runner_index }}.txt
path: '*.txt'
- name: run acceptance tests
run: ./gradlew acceptanceTestNotPrivacy `cat gradleArgs.txt` -Dorg.gradle.parallel=true -Dorg.gradle.caching=true
run: ./gradlew --max-workers 1 acceptanceTestNotPrivacy `cat gradleArgs.txt` -Dorg.gradle.caching=true
- name: Remove downloaded test results
run: rm -rf tmp/junit-xml-reports-downloaded
- name: Upload Acceptance Test Results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,20 @@ public void stop() {
nodeRequests.shutdown();
nodeRequests = null;
}
deleteRuntimeFiles();
}

private void deleteRuntimeFiles() {
try {
Files.deleteIfExists(homeDirectory.resolve("besu.networks"));
} catch (IOException e) {
LOG.error("Failed to clean up besu.networks file in {}", homeDirectory, e);
}
try {
Files.deleteIfExists(homeDirectory.resolve("besu.ports"));
} catch (IOException e) {
LOG.error("Failed to clean up besu.ports file in {}", homeDirectory, e);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,12 @@ private void killBesuProcess(final String name) {
return;
}

LOG.info("Killing {} process, pid {}", name, process.pid());

process.destroy();
process
.descendants()
.peek(
processHandle ->
LOG.info("Killing {} process, pid {}", processHandle.info(), processHandle.pid()))
.forEach(ProcessHandle::destroy);
try {
process.waitFor(30, TimeUnit.SECONDS);
} catch (final InterruptedException e) {
Expand Down

This file was deleted.

Loading

0 comments on commit d691f45

Please sign in to comment.