Skip to content

Fixing an intermittent test failure #306

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

Merged
merged 1 commit into from
Sep 4, 2019
Merged

Fixing an intermittent test failure #306

merged 1 commit into from
Sep 4, 2019

Conversation

hiranya911
Copy link
Contributor

Not sure how, but the recent changes to database tests is causing a test failure in some environments:

Running com.google.firebase.database.FirebaseDatabaseTest
Tests run: 10, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.052 sec <<< FAILURE! - in com.google.firebase.database.FirebaseDatabaseTest
testDbUrlIsEmulatorUrlForDbRefWithPath(com.google.firebase.database.FirebaseDatabaseTest)  Time elapsed: 0.004 sec  <<< ERROR!
java.lang.IllegalArgumentException: Failed to load settings from the system's environment variables
	at com.google.firebase.database.FirebaseDatabaseTest.testDbUrlIsEmulatorUrlForDbRefWithPath(FirebaseDatabaseTest.java:252)
Caused by: com.fasterxml.jackson.core.JsonParseException: 
Unexpected character (',' (code 44)): was expecting double-quote to start field name
 at [Source: (String)"{,,"; line: 1, column: 3]
	at com.google.firebase.database.FirebaseDatabaseTest.testDbUrlIsEmulatorUrlForDbRefWithPath(FirebaseDatabaseTest.java:252)

testDbUrlIsEmulatorUrlWhenSettingOptionsManually(com.google.firebase.database.FirebaseDatabaseTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.IllegalArgumentException: Failed to load settings from the system's environment variables
	at com.google.firebase.database.FirebaseDatabaseTest.testDbUrlIsEmulatorUrlWhenSettingOptionsManually(FirebaseDatabaseTest.java:215)
Caused by: com.fasterxml.jackson.core.JsonParseException: 
Unexpected character (',' (code 44)): was expecting double-quote to start field name
 at [Source: (String)"{,,"; line: 1, column: 3]
	at com.google.firebase.database.FirebaseDatabaseTest.testDbUrlIsEmulatorUrlWhenSettingOptionsManually(FirebaseDatabaseTest.java:215)

Seems to be related to the order of tests. FirebaseAppTest has some test cases where they set the FIREBASE_CONFIG env variable to malformed values like {,,. These values are not cleared and are picked up by later tests.

@hiranya911 hiranya911 merged commit dbe3504 into master Sep 4, 2019
@hiranya911 hiranya911 deleted the hkj-test-fix branch September 4, 2019 20:35
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

Successfully merging this pull request may close these issues.

2 participants