localstack / localstack-java-utils

ā˜• Java utilities and JUnit integration for LocalStack
Apache License 2.0
75 stars 43 forks source link

Error when run make test #4

Closed pkiller520 closed 4 years ago

pkiller520 commented 4 years ago

When I am attempt to upgrade the project to java 11 (https://github.com/localstack/localstack/issues/2093), I encountered this issue when I run "make test".

[ERROR] Tests run: 6, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 35.166 s <<< FAILURE! - in cloud.localstack.S3FeaturesTest [ERROR] testPresignedURLUpload(cloud.localstack.S3FeaturesTest) Time elapsed: 0.075 s <<< ERROR! javax.net.ssl.SSLPeerUnverifiedException: Certificate for doesn't match any of the subject alternative names: [localhost.localstack.cloud] at cloud.localstack.S3FeaturesTest.testPresignedURLUpload(S3FeaturesTest.java:187)

The workaround for it is to either turn off the SSL by setting USE_SSEL=0

test: ## Run tests for Java/JUnit compatibility USE_SSL=0 SERVICES=serverless,kinesis,sns,sqs,cloudwatch mvn $(MVN_ARGS) test

or change the replace the localhost name localhost.localstack.cloud in LocalStack.java.

UPDATE: Change the localhost name does not help when it comes to travis ci job. Setting USE_SSL=0 does the trick.

whummer commented 4 years ago

Thanks for reporting @pkiller520 - this has been fixed in the meantime šŸ‘

pkiller520 commented 4 years ago

Thank you @whummer .

I update the master branch to re-run the test with the following command USE_SSL=1 SERVICES=serverless,kinesis,sns,sqs,iam,cloudwatch mvn clean install test.

I encountered the errors during the test run below: May 10, 2020 1:15:21 PM cloud.localstack.docker.Container createLocalstackContainer INFO: Started container: bad053e42ddb316a061d8c7889dbe09c282d611c949550480c718793b8527ee3 May 10, 2020 1:15:21 PM cloud.localstack.Localstack startup INFO: Waiting for LocalStack container to be ready... May 10, 2020 1:15:49 PM cloud.localstack.docker.Container stop INFO: Stopped container: bad053e42ddb316a061d8c7889dbe09c282d611c949550480c718793b8527ee3 May 10, 2020 1:15:49 PM com.amazonaws.http.AmazonHttpClient createSocketFactoryRegistry WARNING: SSL Certificate checking for endpoints has been explicitly disabled. May 10, 2020 1:15:50 PM cloud.localstack.docker.Container stop INFO: Stopped container: bad053e42ddb316a061d8c7889dbe09c282d611c949550480c718793b8527ee3 [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 169.724 s <<< FAILURE! - in cloud.localstack.docker.LocalstackDockerTest [ERROR] startup(cloud.localstack.docker.LocalstackDockerTest) Time elapsed: 140.438 s <<< ERROR! cloud.localstack.docker.exception.LocalstackDockerException: Could not start the localstack docker container. at cloud.localstack.docker.LocalstackDockerTest.startup(LocalstackDockerTest.java:30) Caused by: java.lang.IllegalStateException: Could not find token: Ready\. in Docker logs: Waiting for all LocalStack services to be ready Waiting for all LocalStack services to be ready 2020-05-10T13:14:38:WARNING:localstack.services.plugins: Service "dynamodb" not yet available, retrying... Waiting for all LocalStack services to be ready Waiting for all LocalStack services to be ready 2020-05-10T13:14:52:WARNING:localstack.services.plugins: Service "dynamodb" not yet available, retrying... Waiting for all LocalStack services to be ready Waiting for all LocalStack services to be ready 2020-05-10T13:15:06:WARNING:localstack.services.plugins: Service "dynamodb" not yet available, retrying... Waiting for all LocalStack services to be ready at cloud.localstack.docker.LocalstackDockerTest.startup(LocalstackDockerTest.java:30) I am able to reproduce the issue from my local environment as well as in travis building server.

Looks like this has been reported in the main localstack project in the past. https://github.com/localstack/localstack/issues/1271 https://github.com/localstack/localstack/issues/862

The main reason for me to run the test is because I would like to make this util support java11. https://github.com/localstack/localstack/issues/2093.