GoogleCloudPlatform / GoogleCloudPlatform/spring-cloud-gcp
flaky test (datastore): DatastoreSampleApplicationIntegrationTests
- Dominant language
- Java
- Stars
- 551
- Forks
- 349
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
Full [log](https://github.com/GoogleCloudPlatform/spring-cloud-gcp/actions/runs/15641608829/job/44070015864?pr=3848), error message:
```
Error: 4:858 [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 12.98 s <<< FAILURE! -- in com.example.DatastoreSampleApplicationIntegrationTests
Error: 4:859 [ERROR] com.example.DatastoreSampleApplicationIntegrationTests.runTests -- Time elapsed: 3.666 s <<< FAILURE!
org.opentest4j.AssertionFailedError:
[Verify Delete]
Expecting actual:
[Singer***singerId='null', firstName='John', lastName='Doe', albums=null, firstBand=null, bands=, personalInstruments=***,
Singer***singerId='null', firstName='Jane', lastName='Doe', albums=null, firstBand=null, bands=, personalInstruments=***,
Singer***singerId='null', firstName='Richard', lastName='Roe', albums=null, firstBand=null, bands=, personalInstruments=***]
to contain exactly (and in same order):
[Singer***singerId='null', firstName='Frodo', lastName='Baggins', albums=null, firstBand=null, bands=, personalInstruments=***,
Singer***singerId='null', firstName='Jane', lastName='Doe', albums=null, firstBand=null, bands=, personalInstruments=***,
Singer***singerId='null', firstName='Richard', lastName='Roe', albums=null, firstBand=null, bands=, personalInstruments=***]
but some elements were not found:
[Singer***singerId='null', firstName='Frodo', lastName='Baggins', albums=null, firstBand=null, bands=, personalInstruments=***]
and others were not expected:
[Singer***singerId='null', firstName='John', lastName='Doe', albums=null, firstBand=null, bands=, personalInstruments=***]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at com.example.DatastoreSampleApplicationIntegrationTests.basicTest(DatastoreSampleApplicationIntegrationTests.java:138)
at com.example.DatastoreSampleApplicationIntegrationTests.runTests(DatastoreSampleApplicationIntegrationTests.java:94)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
```
at glance, this seems a racing condition in test setup?
Contributor guide
Research direction
Start with DatastoreSampleApplicationIntegrationTests, especially basicTest at line 138 and runTests at line 94, then review the linked CI log. Reproduce the failure and determine whether test setup or datastore state ordering causes the mismatch; done means the integration test is deterministic and passes reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- databases, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100