quarkus-qe / quarkus-test-suite

16 stars 34 forks source link

Add test coverage for #43364 - InputStream when using multipart #2188

Closed jcarranzan closed 1 week ago

jcarranzan commented 1 week ago

Summary

Add test coverage for the optional media type handling in InputStream multipart requests, testing Rest client-side and HTTP server-side handling. Addressing the issue https://github.com/quarkusio/quarkus/issues/43364 with the fix https://github.com/quarkusio/quarkus/pull/43985/commits/f6710518a8cc293664b888db7617047d30e2b5f8

Please select the relevant options.

Checklist:

jcarranzan commented 1 week ago

run tests

jedla97 commented 1 week ago

Also test failiures seems relevant, So please look at them.

jcarranzan commented 1 week ago

run tests

github-actions[bot] commented 1 week ago

Following jobs contain at least one flaky test:

Run summary: https://github.com/quarkus-qe/quarkus-test-suite/actions/runs/11855005836?pr=2188

Flaky tests:


io.quarkus.ts.messaging.kafka.reactive.streams.KafkaGratefulShutdownIT.testConnection

org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a Lambda expression in io.quarkus.test.utils.LogsVerifier Log does not contain any of '[ave]'. Full logs: [__  ____  __  _____   ___  __ ____  ______ ,  --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ ,  -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   , --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   , 12:32:46,659 SRMSG18229: Configured topics for channel 'slow': [slow], 12:32:46,677 SRMSG18214: Key deserializer omitted, using String as default, 12:32:46,678 SRMSG18234: Auto-commit disabled for channel slow, 12:32:46,870 SRMSG18240: 'throttled' commit strategy used for channel 'slow', 12:32:46,871 SRMSG18232: Will commit for group 'kafka-streams-reactive-messaging' every 5000 milliseconds., 12:32:46,871 SRMSG18236: Will mark throttled commit strategy for group 'kafka-streams-reactive-messaging' as unhealthy if records go more than 60000 milliseconds without being processed., 12:32:46,911 SRMSG18248: Key serializer omitted, using String as default, 12:32:46,943 SRMSG18258: Kafka producer kafka-producer-slow-topic, connected to Kafka brokers 'localhost:32826', is configured to write records to 'slow', 12:32:46,995 SRMSG18257: Kafka consumer kafka-consumer-slow, connected to Kafka brokers 'localhost:32826', belongs to the 'kafka-streams-reactive-messaging' consumer group and is configured to poll records from [slow], 12:32:46,997 No Topology producer; Kafka Streams will not be started, 12:32:47,090 kafka-streams-reactive-messaging 1.0.0-SNAPSHOT on JVM (powered by Quarkus 999-SNAPSHOT) started in 1.379s. Listening on: http://0.0.0.0:1104, 12:32:47,091 Profile prod activated. , 12:32:47,091 Installed features: [cdi, kafka-client, kafka-streams, messaging, messaging-kafka, resteasy, resteasy-jsonb, smallrye-context-propagation, vertx], 12:32:47,231 [Consumer clientId=kafka-consumer-slow, groupId=kafka-streams-reactive-messaging] Error while fetching metadata with correlation id 2 : {slow=UNKNOWN_TOPIC_OR_PARTITION}, 12:32:50,668 SRMSG18209: Sending message org.eclipse.microprofile.reactive.messaging.Message$5@1a9f1cc5 from channel 'slow-topic' to Kafka topic 'slow', 12:32:50,754 SRMSG18211: Message org.eclipse.microprofile.reactive.messaging.Message$5@1a9f1cc5 from channel 'slow-topic' sent successfully to Kafka topic-partition 'slow-0', with offset 0] ==> expected: <true> but was: <false> within 30 seconds.
    at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
    at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
    at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
    at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
    at org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:790)
    at io.quarkus.test.utils.AwaitilityUtils.untilAsserted(AwaitilityUtils.java:134)
    at io.quarkus.test.utils.AwaitilityUtils.untilAsserted(AwaitilityUtils.java:124)
    at io.quarkus.test.utils.LogsVerifier.assertContains(LogsVerifier.java:28)
    at io.quarkus.ts.messaging.kafka.reactive.streams.KafkaGratefulShutdownIT.testConnection(KafkaGratefulShutdownIT.java:72)
    at java.base/java.lang.reflect.Method.invoke(Method.java:569)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: org.opentest4j.AssertionFailedError: Log does not contain any of '[ave]'. Full logs: [__  ____  __  _____   ___  __ ____  ______ ,  --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ ,  -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   , --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   , 12:32:46,659 SRMSG18229: Configured topics for channel 'slow': [slow], 12:32:46,677 SRMSG18214: Key deserializer omitted, using String as default, 12:32:46,678 SRMSG18234: Auto-commit disabled for channel slow, 12:32:46,870 SRMSG18240: 'throttled' commit strategy used for channel 'slow', 12:32:46,871 SRMSG18232: Will commit for group 'kafka-streams-reactive-messaging' every 5000 milliseconds., 12:32:46,871 SRMSG18236: Will mark throttled commit strategy for group 'kafka-streams-reactive-messaging' as unhealthy if records go more than 60000 milliseconds without being processed., 12:32:46,911 SRMSG18248: Key serializer omitted, using String as default, 12:32:46,943 SRMSG18258: Kafka producer kafka-producer-slow-topic, connected to Kafka brokers 'localhost:32826', is configured to write records to 'slow', 12:32:46,995 SRMSG18257: Kafka consumer kafka-consumer-slow, connected to Kafka brokers 'localhost:32826', belongs to the 'kafka-streams-reactive-messaging' consumer group and is configured to poll records from [slow], 12:32:46,997 No Topology producer; Kafka Streams will not be started, 12:32:47,090 kafka-streams-reactive-messaging 1.0.0-SNAPSHOT on JVM (powered by Quarkus 999-SNAPSHOT) started in 1.379s. Listening on: http://0.0.0.0:1104, 12:32:47,091 Profile prod activated. , 12:32:47,091 Installed features: [cdi, kafka-client, kafka-streams, messaging, messaging-kafka, resteasy, resteasy-jsonb, smallrye-context-propagation, vertx], 12:32:47,231 [Consumer clientId=kafka-consumer-slow, groupId=kafka-streams-reactive-messaging] Error while fetching metadata with correlation id 2 : {slow=UNKNOWN_TOPIC_OR_PARTITION}, 12:32:50,668 SRMSG18209: Sending message org.eclipse.microprofile.reactive.messaging.Message$5@1a9f1cc5 from channel 'slow-topic' to Kafka topic 'slow', 12:32:50,754 SRMSG18211: Message org.eclipse.microprofile.reactive.messaging.Message$5@1a9f1cc5 from channel 'slow-topic' sent successfully to Kafka topic-partition 'slow-0', with offset 0] ==> expected: <true> but was: <false>
    at io.quarkus.test.utils.LogsVerifier.lambda$assertContains$0(LogsVerifier.java:30)
    at org.awaitility.core.AssertionCondition.lambda$new$0(AssertionCondition.java:53)
    at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248)
    at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)


github-actions[bot] commented 1 week ago

Following jobs contain at least one flaky test:

Run summary: https://github.com/quarkus-qe/quarkus-test-suite/actions/runs/11858961713?pr=2188

Flaky tests:


io.quarkus.ts.opentelemetry.reactive.OpentelemetryReactiveIT.testSecurityEvents

org.awaitility.core.ConditionTimeoutException: 
Assertion condition defined as a Lambda expression in io.quarkus.ts.opentelemetry.reactive.OpentelemetryReactiveIT 1 expectation failed.
JSON path data[0].spans.findAll { span -> span.operationName == 'GET /admin' }[0].logs.flatten().findAll { log -> log.fields.find { field -> field.key == 'event' && field.value == 'quarkus.security.authorization.success' } } doesn't match.
Expected: is not an empty collection
  Actual: <[]>
 within 30 seconds.
    at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
    at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
    at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
    at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1006)
    at org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:790)
    at io.quarkus.ts.opentelemetry.reactive.OpentelemetryReactiveIT.testSecurityEvents(OpentelemetryReactiveIT.java:82)
    at java.base/java.lang.reflect.Method.invoke(Method.java:569)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.AssertionError: 1 expectation failed.
JSON path data[0].spans.findAll { span -> span.operationName == 'GET /admin' }[0].logs.flatten().findAll { log -> log.fields.find { field -> field.key == 'event' && field.value == 'quarkus.security.authorization.success' } } doesn't match.
Expected: is not an empty collection
  Actual: <[]>

    at java.base/jdk.internal.reflect.GeneratedConstructorAccessor75.newInstance(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:73)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
    at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:512)
    at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)
    at io.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:696)
    at io.restassured.internal.ResponseSpecificationImpl.this$2$validateResponseIfRequired(ResponseSpecificationImpl.groovy)
    at jdk.internal.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:569)
    at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:198)
    at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:62)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
    at io.restassured.internal.ResponseSpecificationImpl.body(ResponseSpecificationImpl.groovy:270)
    at io.restassured.specification.ResponseSpecification$body$1.callCurrent(Unknown Source)
    at io.restassured.internal.ResponseSpecificationImpl.body(ResponseSpecificationImpl.groovy:117)
    at io.restassured.internal.ValidatableResponseOptionsImpl.body(ValidatableResponseOptionsImpl.java:244)
    at io.quarkus.ts.opentelemetry.reactive.OpentelemetryReactiveIT.assertSecurityEventsAndLogsPresent(OpentelemetryReactiveIT.java:145)
    at io.quarkus.ts.opentelemetry.reactive.OpentelemetryReactiveIT.lambda$testSecurityEvents$3(OpentelemetryReactiveIT.java:85)
    at org.awaitility.core.AssertionCondition.lambda$new$0(AssertionCondition.java:53)
    at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:248)
    at org.awaitility.core.ConditionAwaiter$ConditionPoller.call(ConditionAwaiter.java:235)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)


jcarranzan commented 1 week ago

run tests

jcarranzan commented 1 week ago

run tests

jedla97 commented 1 week ago

Looking at failing native, it seems that all module were executed.

Looking at detect module job there is lots of files which were not modified here. It seems that this PR is not rebased so it caused this problem. Will create QQE for this.

The all http-advanced-reactive and rest-client-reactive were executed and they are not failing so merging.

michalvavrik commented 1 week ago

Looking at detect module job there is lots of files which were not modified here. It seems that this PR is not rebased so it caused this problem. Will create QQE for this.

Diff is performed on changes between this PR and main I think, which seems correct to me. To be clear, it is absolutely wrong that all these tests were run for nothing, but it's not clear to me what would you do, do diff between PR head and previous commit that is not the HEAD? Basically on the diff you can see here: https://github.com/quarkus-qe/quarkus-test-suite/pull/2188/files.

I am not sure if this is issue, I can the issue is that this PR wasn't rebased, but feel free to spend time on this. Personally I am -1 to hunt perfect setup if it cost more than one hour. Mainly because I already did and it's hard to debug this GH action that determines it.

michalvavrik commented 1 week ago

TBH if that is goal (to basically use only changed files), I think we are wasting time with the tj-actions/changed-files@v45 action, we could just list changed files with git. But I guess changed files is not the same thing as the diff between main and this PR. Could this diff between the diff and changed files make a difference in the test failures? I am bit tired to tell, probably not but I'd need to think about it more.