Commit fb03b74
committed
test(spanner): unflake multiUseReadOnlyTransactionCanUseInlineBeginForReadAsync
In `SessionImplTest#multiUseReadOnlyTransactionCanUseInlineBeginForReadAsync`,
mock `rpc.read` invoked stream callbacks synchronously before returning `NoOpStreamingCall`.
This caused a background thread to process rows and invoke `startStream` while `this.stream`
was still unassigned, triggering a duplicate request (`expected:<1> but was:<2>`).
Fix this by dispatching callbacks asynchronously with `CompletableFuture.runAsync`,
allowing `rpc.read` to return and assign `this.stream` before row consumption starts.1 parent d9a8eef commit fb03b74
1 file changed
Lines changed: 7 additions & 2 deletions
File tree
- java-spanner/google-cloud-spanner/src/test/java/com/google/cloud/spanner
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
823 | 824 | | |
824 | 825 | | |
825 | 826 | | |
826 | | - | |
827 | | - | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
828 | 833 | | |
829 | 834 | | |
830 | 835 | | |
| |||
0 commit comments