ptrd / flupke

Java HTTP3 Client and HTTP3 Server plugin for Kwik
GNU General Public License v3.0
15 stars 4 forks source link

net.luminis.http3.impl.Http3ClientConnectionImplTest > receivingResponseWithInputStreamAndMultipleDataFramesShouldWork FAILED #7

Closed AlexanderSchuetz97 closed 1 year ago

AlexanderSchuetz97 commented 1 year ago

Hello, when building flupke a test fails.

Git commit id: 7795a34080c9de24093dbef72c285635a70cb6df

OS: Windows 11 JVM in JAVA_HOME env variable: JAVA_VERSION=11.0.14.1, JAVA_VENDOR=Eclipse Adoptium, RUNTIME_NAME=OpenJDK Runtime Environment, RUNTIME_VERSION=11.0.14.1+1, VM_NAME=OpenJDK 64-Bit Server VM, VM_VERSION=11.0.14.1+1

Commands from windows Powershell: git clone https://github.com/ptrd/flupke.git git submodule update --init --recursive ./gradlew build -iS

Note: it fails without "-iS" but that just gives more insight into what actually fails. This test fails 100% of the time. I tested 3 times.

Note: Error does not occur when using java 17!

Output:

Task :test Caching disabled for task ':test' because: Build cache is disabled Task ':test' is not up-to-date because: Task has failed previously. Starting process 'Gradle Test Executor 1'. Working directory: C:\Users\schuetz\Desktop\flupke\flupke Command: C:\0\java11\bin\java.exe -Dorg.gradle.internal.worker.tmpdir=C:\Users\schuetz\Desktop\flupke\flupke\build\tmp\test\work -Dorg.gradle.native=false @C:\Users\schuetz.gradle.tmp\gradle-worker-classpath12201495097954922696txt -Xmx512m -Dfile.encoding=windows-1252 -Duser.country=DE -Duser.language=de -Duser.variant -ea worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Test Executor 1' Successfully started process 'Gradle Test Executor 1'

net.luminis.http3.impl.Http3ClientConnectionImplTest > receivingResponseWithInputStreamAndMultipleDataFramesShouldWork FAILED java.lang.AssertionError at java.net.http/jdk.internal.net.http.ResponseSubscribers$HttpResponseInputStream.read(ResponseSubscribers.java:408) at java.base/java.io.InputStream.readNBytes(InputStream.java:396) at java.base/java.io.InputStream.readAllBytes(InputStream.java:333) at net.luminis.http3.impl.Http3ClientConnectionImplTest.receivingResponseWithInputStreamAndMultipleDataFramesShouldWork(Http3ClientConnectionImplTest.java:225)

net.luminis.http3.server.file.FileServerTest > handleSimpleFileRequest STANDARD_OUT 10.0.0.58 - - [4/Sep./2023:14:56:47 +0200] GET file HTTP/3 0 0

net.luminis.http3.server.file.FileServerTest > testFileNotFoundRequest STANDARD_OUT 10.0.0.58 - - [4/Sep./2023:14:56:47 +0200] GET doesnotexist HTTP/3 0 0

Gradle Test Executor 1 finished executing tests.

Task :test FAILED Results: FAILURE (81 tests, 80 successes, 1 failures, 0 skipped)

81 tests completed, 1 failed

ptrd commented 1 year ago

This is actually a bug in the JDK ;-). There is an assert in the JDK code that the bytes-to-read is not 0, which is wrong, because the contract explicitly states that you can request 0 bytes. Also, I cannot "fix" (work-around) it, because the code that calls the offending method is also in the JDK. So the solution is to use a newer JDK. Or disable assertions ;-)

See https://bugs.openjdk.org/browse/JDK-8228970

AlexanderSchuetz97 commented 1 year ago

Ok good to know, i was just a bit worried. I have just skipped the test for the java 11 build since it passes with java 17.