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

TestResourceException: Invalid status line #718

Open
nathanielarellano-cubic opened this issue Sep 18, 2024 · 0 comments
Open

TestResourceException: Invalid status line #718

nathanielarellano-cubic opened this issue Sep 18, 2024 · 0 comments

Comments

@nathanielarellano-cubic

Expected Behavior

Successfully run test classes annotated with @MicronautTest when Micronaut Test Resource Server is running.

Note:
This used to work for me with no issue. Since then, I haven't made dependency updates. Only code updates. I also have issues starting/stopping the test resource service. Any help in knowing how to find/kill the test resource process is appreciated.

Actual Behaviour

When I run my tests annotated with @MicronautTest via Maven commands or IntelliJ, I receive the following error:

io.micronaut.testresources.client.TestResourcesException: java.io.IOException: Invalid status line: "��������A{"Dns4":{"ProtectionState":"open"},"Ip4":{"ProtectionState":"notProtected","connectionError":"false"},"Dns6":{"ProtectionState":"open"},"Ip6":{"ProtectionState":"notProtected","connectionError":"false"},"LastConnectedTime":"0","LogUploadEnabled":"false","ClientName":"UnknownClient","UserName":"UnknownUser","AgentStatus":"noOrginfo","SWG":{"State":"unprotected","Licensed":"false","Enabled":"false"}}"

	at io.micronaut.testresources.client.DefaultTestResourcesClient.request(DefaultTestResourcesClient.java:157)
	at io.micronaut.testresources.client.DefaultTestResourcesClient.getRequiredPropertyEntries(DefaultTestResourcesClient.java:104)
	at java.base/java.util.Optional.map(Optional.java:260)
	at io.micronaut.testresources.client.TestResourcesClientPropertySourceLoader$ClientTestResourcesResolver.getPropertyEntries(TestResourcesClientPropertySourceLoader.java:50)
	at io.micronaut.testresources.core.LazyTestResourcesPropertySourceLoader$LazyPropertySource.computeKeys(LazyTestResourcesPropertySourceLoader.java:98)
	at io.micronaut.testresources.core.LazyTestResourcesPropertySourceLoader$LazyPropertySource.iterator(LazyTestResourcesPropertySourceLoader.java:90)
	at io.micronaut.context.env.PropertySourcePropertyResolver.processPropertySource(PropertySourcePropertyResolver.java:588)
	at io.micronaut.context.env.DefaultEnvironment.readPropertySources(DefaultEnvironment.java:459)
	at io.micronaut.context.env.DefaultEnvironment.start(DefaultEnvironment.java:277)
	at io.micronaut.context.DefaultApplicationContext$RuntimeConfiguredEnvironment.start(DefaultApplicationContext.java:909)
	at io.micronaut.context.DefaultApplicationContext$RuntimeConfiguredEnvironment.start(DefaultApplicationContext.java:878)
	at io.micronaut.context.DefaultApplicationContext.startEnvironment(DefaultApplicationContext.java:266)
	at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:201)
	at io.micronaut.test.extensions.AbstractMicronautExtension.startApplicationContext(AbstractMicronautExtension.java:507)
	at io.micronaut.test.extensions.AbstractMicronautExtension.beforeClass(AbstractMicronautExtension.java:346)
	at io.micronaut.test.extensions.junit5.MicronautJunit5Extension.beforeAll(MicronautJunit5Extension.java:84)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.io.IOException: Invalid status line: "��������A{"Dns4":{"ProtectionState":"open"},"Ip4":{"ProtectionState":"notProtected","connectionError":"false"},"Dns6":{"ProtectionState":"open"},"Ip6":{"ProtectionState":"notProtected","connectionError":"false"},"LastConnectedTime":"0","LogUploadEnabled":"false","ClientName":"UnknownClient","UserName":"UnknownUser","AgentStatus":"noOrginfo","SWG":{"State":"unprotected","Licensed":"false","Enabled":"false"}}"
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:586)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:119)
	at io.micronaut.testresources.client.DefaultTestResourcesClient.request(DefaultTestResourcesClient.java:140)
	... 16 more
Caused by: java.net.ProtocolException: Invalid status line: "��������A{"Dns4":{"ProtectionState":"open"},"Ip4":{"ProtectionState":"notProtected","connectionError":"false"},"Dns6":{"ProtectionState":"open"},"Ip6":{"ProtectionState":"notProtected","connectionError":"false"},"LastConnectedTime":"0","LogUploadEnabled":"false","ClientName":"UnknownClient","UserName":"UnknownUser","AgentStatus":"noOrginfo","SWG":{"State":"unprotected","Licensed":"false","Enabled":"false"}}"
	at java.net.http/jdk.internal.net.http.Http1HeaderParser.protocolException(Http1HeaderParser.java:342)
	at java.net.http/jdk.internal.net.http.Http1HeaderParser.readStatusLineFeed(Http1HeaderParser.java:190)
	at java.net.http/jdk.internal.net.http.Http1HeaderParser.parse(Http1HeaderParser.java:121)
	at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.handle(Http1Response.java:690)
	at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.handle(Http1Response.java:621)
	at java.net.http/jdk.internal.net.http.Http1Response$Receiver.accept(Http1Response.java:612)
	at java.net.http/jdk.internal.net.http.Http1Response$HeadersReader.tryAsyncReceive(Http1Response.java:668)
	at java.net.http/jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:233)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
	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:833)

Steps To Reproduce

  1. Create test class and annotate with @MicronautTest
  2. Create test
  3. Start test service via mvn mn:start-testresources-service
  4. Run test
  5. See error

Environment Information

  • OS: Mac
  • Maven
  • Java 17
  • Various Micronaut Dependency Versions
[INFO] +- io.micronaut.data:micronaut-data-hibernate-jpa:jar:4.7.0:compile
[INFO] |  +- io.micronaut:micronaut-inject:jar:4.4.9:compile
[INFO] |  |  \- io.micronaut:micronaut-core:jar:4.4.9:compile
[INFO] |  +- io.micronaut.data:micronaut-data-runtime:jar:4.7.1:compile
[INFO] |  +- io.micronaut.data:micronaut-data-model:jar:4.7.1:compile
[INFO] |  +- io.micronaut.data:micronaut-data-jpa:jar:4.7.1:compile
[INFO] +- io.micronaut.sql:micronaut-hibernate-jpa:jar:5.6.0:compile
[INFO] |  +- io.micronaut.validation:micronaut-validation:jar:4.5.0:compile
[INFO] |  |  \- io.micronaut.reactor:micronaut-reactor:jar:3.3.0:runtime
[INFO] |  +- io.micronaut:micronaut-aop:jar:4.4.9:compile
[INFO] |  \- io.micronaut.sql:micronaut-jdbc:jar:5.6.0:compile
[INFO] +- io.micronaut.data:micronaut-data-tx-hibernate:jar:4.7.1:compile
[INFO] |  +- io.micronaut.data:micronaut-data-tx:jar:4.7.1:compile
[INFO] |  |  \- io.micronaut.data:micronaut-data-connection:jar:4.7.1:compile
[INFO] |  +- io.micronaut.data:micronaut-data-tx-jdbc:jar:4.7.1:compile
[INFO] |  |  \- io.micronaut.data:micronaut-data-connection-jdbc:jar:4.7.1:compile
[INFO] |  \- io.micronaut.data:micronaut-data-connection-hibernate:jar:4.7.1:compile
[INFO] +- io.micronaut.sql:micronaut-jdbc-hikari:jar:5.6.0:compile
[INFO] +- io.micronaut.beanvalidation:micronaut-hibernate-validator:jar:4.3.0:compile
[INFO] +- io.micronaut.flyway:micronaut-flyway:jar:7.2.0:compile
[INFO] |  +- io.micronaut:micronaut-management:jar:4.4.9:compile
[INFO] |  |  \- io.micronaut:micronaut-router:jar:4.4.9:compile
[INFO] +- io.micronaut.serde:micronaut-serde-jackson:jar:2.9.0:compile
[INFO] |  +- io.micronaut:micronaut-jackson-core:jar:4.4.9:compile
[INFO] |  +- io.micronaut:micronaut-context:jar:4.4.9:compile
[INFO] |  +- io.micronaut.serde:micronaut-serde-api:jar:2.9.0:compile
[INFO] |  \- io.micronaut.serde:micronaut-serde-support:jar:2.9.0:runtime
[INFO] +- io.micronaut.servlet:micronaut-http-server-tomcat:jar:4.7.0:compile
[INFO] |  +- io.micronaut.servlet:micronaut-servlet-engine:jar:4.7.0:compile
[INFO] |  |  +- io.micronaut.servlet:micronaut-servlet-core:jar:4.7.0:compile
[INFO] |  |  |  \- io.micronaut:micronaut-http-server:jar:4.4.9:compile
[INFO] +- io.micronaut:micronaut-runtime:jar:4.5.1:compile
[INFO] |  +- io.micronaut:micronaut-discovery-core:jar:4.4.9:compile
[INFO] |  +- io.micronaut:micronaut-context-propagation:jar:4.4.9:compile
[INFO] |  +- io.micronaut:micronaut-core-reactive:jar:4.4.9:compile
[INFO] |  +- io.micronaut:micronaut-http:jar:4.4.9:compile
[INFO] |  \- io.micronaut:micronaut-retry:jar:4.4.9:compile
[INFO] +- io.micronaut:micronaut-http-client:jar:4.4.9:compile
[INFO] |  +- io.micronaut:micronaut-http-client-core:jar:4.4.9:compile
[INFO] |  +- io.micronaut:micronaut-websocket:jar:4.4.9:compile
[INFO] |  +- io.micronaut:micronaut-http-netty:jar:4.4.9:compile
[INFO] |  |  +- io.micronaut:micronaut-buffer-netty:jar:4.4.9:compile
[INFO] +- io.micronaut.testresources:micronaut-test-resources-client:jar:2.5.1:provided
[INFO] |  +- io.micronaut:micronaut-json-core:jar:4.4.9:compile
[INFO] |  \- io.micronaut.testresources:micronaut-test-resources-core:jar:2.5.2:provided
[INFO] +- io.micronaut.test:micronaut-test-junit5:jar:4.3.0:test
[INFO] |  \- io.micronaut.test:micronaut-test-core:jar:4.3.0:test

Example Application

No response

Version

4.4.3

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

No branches or pull requests

1 participant