aws-sdk-java icon indicating copy to clipboard operation
aws-sdk-java copied to clipboard

Tests failing when building from source

Open daveagill opened this issue 6 years ago • 5 comments

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)

daveagill avatar Apr 26 '19 15:04 daveagill

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 avatar May 01 '19 22:05 debora-ito

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.

daveagill avatar May 01 '19 23:05 daveagill

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

debora-ito avatar May 16 '19 22:05 debora-ito

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?

reetammitra2904 avatar Mar 10 '22 03:03 reetammitra2904

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

khwbilal avatar Jun 10 '22 12:06 khwbilal