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

Tests failing when building from source #1981

Closed
daveagill opened this issue Apr 26, 2019 · 7 comments
Closed

Tests failing when building from source #1981

daveagill opened this issue Apr 26, 2019 · 7 comments
Labels
feature-request A feature should be added or improved.

Comments

@daveagill
Copy link

Some tests are failing when I build locally on Windows.
I have simply cloned the repo and then run mvn clean install -Dgpg.skip=true

The Reactor Summary says the failures are all in "AWS SDK for Java - Core".

Tests run: 955, Failures: 3, Errors: 5, Skipped: 0

The mvn -v command sums up my environment as follows:

C:\Users\David\aws-sdk>mvn -v
Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T20:00:29+01:00)
Maven home: C:\Users\David\Downloads\apache-maven-3.6.1-bin\apache-maven-3.6.1\bin\..
Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_191\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

I have reproduced this on two separate Windows machines (same version of Java and Maven).

I am aware that the build is currently passing on Travis where it uses a slightly older Java version 1.8.0_121 and is also nix based.

If the issue is related to my versions of Java and/or Maven then if someone knows a combo that is known to work on WIndows I could re-try using those.

The following are the failing tests (click to expand):

com.amazonaws.auth.FullUriCredentialsEndpointProviderTest
Running com.amazonaws.auth.FullUriCredentialsEndpointProviderTest
Tests run: 4, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 0.007 sec <<< FAILURE! - in com.amazonaws.auth.FullUriCredentialsEndpointProviderTest
authorizationHeaderIsPresentIfEnvironmentVariableSet(com.amazonaws.auth.FullUriCredentialsEndpointProviderTest)  Time elapsed: 0.006 sec  <<< FAILURE!
java.lang.AssertionError: 

Expected: <1>
     but: was <0>
	at com.amazonaws.auth.FullUriCredentialsEndpointProviderTest.authorizationHeaderIsPresentIfEnvironmentVariableSet(FullUriCredentialsEndpointProviderTest.java:67)

takesUriFromTheEnvironmentVariable(com.amazonaws.auth.FullUriCredentialsEndpointProviderTest)  Time elapsed: 0 sec  <<< ERROR!
com.amazonaws.SdkClientException: The environment variable AWS_CONTAINER_CREDENTIALS_FULL_URI is empty
	at com.amazonaws.auth.FullUriCredentialsEndpointProviderTest.takesUriFromTheEnvironmentVariable(FullUriCredentialsEndpointProviderTest.java:46)

theLoopbackAddressIsAlsoAcceptable(com.amazonaws.auth.FullUriCredentialsEndpointProviderTest)  Time elapsed: 0 sec  <<< ERROR!
com.amazonaws.SdkClientException: The environment variable AWS_CONTAINER_CREDENTIALS_FULL_URI is empty
	at com.amazonaws.auth.FullUriCredentialsEndpointProviderTest.theLoopbackAddressIsAlsoAcceptable(FullUriCredentialsEndpointProviderTest.java:54)
com.amazonaws.auth.profile.ProfileCredentialsProviderTest
Running com.amazonaws.auth.profile.ProfileCredentialsProviderTest
Tests run: 11, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 4.021 sec <<< FAILURE! - in com.amazonaws.auth.profile.ProfileCredentialsProviderTest
testBoth(com.amazonaws.auth.profile.ProfileCredentialsProviderTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.IllegalArgumentException: No AWS profile named 'bogus'
	at com.amazonaws.auth.profile.ProfileCredentialsProviderTest.testBoth(ProfileCredentialsProviderTest.java:122)

testEnvironmentVariable(com.amazonaws.auth.profile.ProfileCredentialsProviderTest)  Time elapsed: 0.002 sec  <<< FAILURE!
org.junit.ComparisonFailure: expected:<[test]> but was:<[defaultSecretAccessKey]>
	at com.amazonaws.auth.profile.ProfileCredentialsProviderTest.testEnvironmentVariable(ProfileCredentialsProviderTest.java:79)

Running com.amazonaws.auth.profile.ProfilesConfigFileTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in com.amazonaws.auth.profile.ProfilesConfigFileTest
Running com.amazonaws.auth.profile.ProfilesConfigFileWriterTest
Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec <<< FAILURE! - in com.amazonaws.auth.profile.ProfilesConfigFileWriterTest
testInPlaceModificationErrorHandling(com.amazonaws.auth.profile.ProfilesConfigFileWriterTest)  Time elapsed: 0.005 sec  <<< FAILURE!
org.junit.ComparisonFailure: 
expected:<..._session_token=d

[]> but was:<..._session_token=d

[[e]
]>
	at com.amazonaws.auth.profile.ProfilesConfigFileWriterTest.testInPlaceModificationErrorHandling(ProfilesConfigFileWriterTest.java:258)

com.amazonaws.auth.profile.ProfilesConfigFileWriterTest
Running com.amazonaws.auth.profile.ProfilesConfigFileWriterTest
Tests run: 8, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec <<< FAILURE! - in com.amazonaws.auth.profile.ProfilesConfigFileWriterTest
testInPlaceModificationErrorHandling(com.amazonaws.auth.profile.ProfilesConfigFileWriterTest)  Time elapsed: 0.005 sec  <<< FAILURE!
org.junit.ComparisonFailure: 
expected:<..._session_token=d

[]> but was:<..._session_token=d

[[e]
]>
	at com.amazonaws.auth.profile.ProfilesConfigFileWriterTest.testInPlaceModificationErrorHandling(ProfilesConfigFileWriterTest.java:258)
com.amazonaws.monitoring.EnvironmentVariableCsmConfigurationProviderTest
Running com.amazonaws.monitoring.EnvironmentVariableCsmConfigurationProviderTest
Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0 sec <<< FAILURE! - in com.amazonaws.monitoring.EnvironmentVariableCsmConfigurationProviderTest
noPortClientIdSpecified_shouldUseDefaultValues(com.amazonaws.monitoring.EnvironmentVariableCsmConfigurationProviderTest)  Time elapsed: 0 sec  <<< ERROR!
com.amazonaws.SdkClientException: Unable to load Client Side Monitoring configurations from environment variables!
	at com.amazonaws.monitoring.EnvironmentVariableCsmConfigurationProviderTest.noPortClientIdSpecified_shouldUseDefaultValues(EnvironmentVariableCsmConfigurationProviderTest.java:80)

testCorrectlyResolvesConfiguration(com.amazonaws.monitoring.EnvironmentVariableCsmConfigurationProviderTest)  Time elapsed: 0 sec  <<< ERROR!
com.amazonaws.SdkClientException: Unable to load Client Side Monitoring configurations from environment variables!
	at com.amazonaws.monitoring.EnvironmentVariableCsmConfigurationProviderTest.testCorrectlyResolvesConfiguration(EnvironmentVariableCsmConfigurationProviderTest.java:56)
@debora-ito
Copy link
Member

Hi @daveagill, thank you for reaching out. We are aware of the problem and will work to improve the tests so they can be executed successfully on Windows.

As a workaround, you can skip all the tests by running:
mvn clean install -Dgpg.skip=true -DskipTests

@debora-ito debora-ito added the closing-soon This issue will close in 2 days unless further comments are made. label May 1, 2019
@daveagill
Copy link
Author

daveagill commented May 1, 2019

Thanks for the info @debora-ito.

Failing tests does make deving & testing from a Windows machine a wee bit trickier.

If it is difficult to make those tests work on Windows in the short term then perhaps they can be excluded from the suite via a command line arg. Better than a failing build or no tests running at all IMO.

Anyway, since you're aware of the issue, feel free to close this.

@debora-ito
Copy link
Member

We agree, it's not a good developer experience. I'll keep this issue open until we release an update.

@debora-ito debora-ito added guidance Question that needs advice or information. and removed closing-soon This issue will close in 2 days unless further comments are made. labels May 16, 2019
@debora-ito debora-ito added feature-request A feature should be added or improved. and removed guidance Question that needs advice or information. labels Feb 26, 2020
@reetammitra2904
Copy link

I am also seeing failed tests when running it on Ubuntu.
Operating System: Ubuntu 20.04
Java: Open JDK 1.8.0_312
Maven: 3.6.3

Should I create a new issue for this or tag onto this one with the details?

@khwbilal
Copy link

I am facing the same issue when trying to build from the source many tests Errors along with Failures

@debora-ito
Copy link
Member

We apologize but the tests won't get fixed in v1. As a workaround, you can skip the tests by using the "skipTests" option: mvn clean install -Dgpg.skip=true -DskipTests

Java SDK v2 tests on Windows are working well, they are part of the build process triggered for each PR. We recommend migrating to Java SDK v2, and if this is still an issue please let us know and open a new issue in the v2 repo.

Reference:

  • Announcing end-of-support for AWS SDK for Java v1.x effective December 31, 2025 - blog post

@debora-ito debora-ito closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2024
Copy link

This issue is now closed.

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

4 participants