Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8269036: tools/jpackage/share/AppImagePackageTest.java failed with "h…
…diutil: create failed - Resource busy"

Reviewed-by: asemenyuk, herrick
  • Loading branch information
Alexander Matveev committed Jun 25, 2021
1 parent 5ebed06 commit fb0a95fed46a04475697204de576c57f98d5b55a
@@ -346,7 +346,11 @@ private Path buildDMG( Map<String, ? super Object> params,
"-volname", APP_NAME.fetchFrom(params),
"-ov", protoDMG.toAbsolutePath().toString(),
"-fs", "HFS+");
IOUtils.exec(pb, false, null, true, Executor.INFINITE_TIMEOUT);
new RetryExecutor()
.setMaxAttemptsCount(10)
.setAttemptTimeoutMillis(3000)
.setWriteOutputToFile(true)
.execute(pb);
}

// mount temp image
@@ -32,6 +32,7 @@
public RetryExecutor() {
setMaxAttemptsCount(5);
setAttemptTimeoutMillis(2 * 1000);
setWriteOutputToFile(false);
}

public RetryExecutor setMaxAttemptsCount(int v) {
@@ -44,6 +45,11 @@ public RetryExecutor setAttemptTimeoutMillis(int v) {
return this;
}

RetryExecutor setWriteOutputToFile(boolean v) {
writeOutputToFile = v;
return this;
}

public RetryExecutor setExecutorInitializer(Consumer<Executor> v) {
executorInitializer = v;
return this;
@@ -69,11 +75,13 @@ static RetryExecutor retryOnKnownErrorMessage(String v) {
}

public void execute(String cmdline[]) throws IOException {
executeLoop(() -> Executor.of(cmdline));
executeLoop(() ->
Executor.of(cmdline).setWriteOutputToFile(writeOutputToFile));
}

public void execute(ProcessBuilder pb) throws IOException {
executeLoop(() -> Executor.of(pb));
executeLoop(() ->
Executor.of(pb).setWriteOutputToFile(writeOutputToFile));
}

private void executeLoop(Supplier<Executor> execSupplier) throws IOException {
@@ -109,4 +117,5 @@ private void executeLoop(Supplier<Executor> execSupplier) throws IOException {
private boolean aborted;
private int attempts;
private int timeoutMillis;
private boolean writeOutputToFile;
}

1 comment on commit fb0a95f

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on fb0a95f Jun 25, 2021

Please sign in to comment.