[JAVA-3969] Investigate implicit session test failure Created: 27/Jan/21 Updated: 01/Mar/21 Resolved: 01/Mar/21 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Reactive Streams, Test Coverage |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | Investigate flaky tests | ||||||||
| Description |
|
| Comments |
| Comment by Jeffrey Yemin [ 01/Mar/21 ] |
|
Opened |
| Comment by Jeffrey Yemin [ 01/Mar/21 ] |
|
Decided on fourth option, after discussion with valentin.male.kovalenko@gmail.com. Since we document that Californium is supported, we should ensure that the driver behaves consistently and as expected when using that release. Therefore, we should stop depending on the behavior of Mono#doOnTerminate being consistent across all releases. This is easy to do: just wrap the sinkToCallback in another callback that first releases the binding. |
| Comment by Jeffrey Yemin [ 01/Mar/21 ] |
|
Mystery solved. We're testing with Californium-S-17 release of Project Reactor. The behavior for Mono#doOnTerminate mentioned in the previous comment was not specified until a later release of Project Reactor. Testing with Dysprosium-SR17, I observe the documented behavior and the test no longer fails. The question now is what to do about it. Options include:
|
| Comment by Jeffrey Yemin [ 22/Feb/21 ] |
|
The documentation of Mono#doOnTerminate seems to contradict my findings. It claims that
|
| Comment by Jeffrey Yemin [ 22/Feb/21 ] |
|
The test is trying to prove that the second operation in a sequence of two operations uses the same server session as was created by the first operation. For a synchronous client, this works fine, but in the reactive streams driver it sometimes fails. The root cause of this appears to be quite straightforward. The sequence of events is as follows:
I think we could make this pass consistently by releasing the ClientSession prior to executing onNext, instead of using Mono#doOnTerminate. But I'm not sure it's worth it, and we might just want to skip the test. |