Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus Tests with SmallRye Health Extension Sometimes Fail When Run In Parallel #21245

Closed
mchristiansen opened this issue Nov 6, 2021 · 3 comments · Fixed by #21272
Closed
Labels
Milestone

Comments

@mchristiansen
Copy link

Describe the bug

After adding extension io.quarkus:quarkus-smallrye-health running multiple tests in parallel sometimes causes NoSuchFileException.

Caused by: java.nio.file.NoSuchFileException: /var/folders/1z/vlh4t0fj7qx8dldd244qst9w0000gp/T/quarkus/com.example/health-ui-no-such-file/io.smallrye/smallrye-health-ui/3.1.2/healthui.js
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:371)
	at java.base/java.nio.file.Files.newByteChannel(Files.java:422)
	at java.base/java.nio.file.Files.readAllBytes(Files.java:3206)
	at io.quarkus.smallrye.health.deployment.SmallRyeHealthProcessor.updateApiUrl(SmallRyeHealthProcessor.java:500)
	at io.quarkus.smallrye.health.deployment.SmallRyeHealthProcessor.registerUiExtension(SmallRyeHealthProcessor.java:436)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:821)

Best I can tell digging through the source, ui resources are being extracted from the smallrye-health-ui jar and put into a temporary directory, but that location is not unique per test and is being cleaned prior to extraction, so tests running in parallel can cause already extracted files to be deleted and subsequent errors on read.

I'm running multiple tests in parallel in gradle with:

test {
  maxParallelForks = 4
}

This is still an issue even with the health ui is disabled via quarkus.smallrye-health.ui.enable = false

Expected behavior

Tests run in parallel do not fail due to the extension io.quarkus:quarkus-smallrye-health being applied.

Actual behavior

Build fails with above exception.

How to Reproduce?

health-ui-no-such-file.zip

The above project reproduces the issue pretty consistently for me just running ./gradlew build

Output of uname -a or ver

Darwin WMac5205964 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64

Output of java -version

openjdk version "11.0.11" 2021-04-20

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.4.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.2

Additional information

No response

@mchristiansen mchristiansen added the kind/bug Something isn't working label Nov 6, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 6, 2021

@xstefank
Copy link
Member

xstefank commented Nov 8, 2021

@phillip-kruger do you want to look into this? I will have time only later this week.

@phillip-kruger
Copy link
Member

I'll have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants