Commit df3e568
committed
test(fetch): stub internal drain primitives in fetchAll unit test
The fetchAll() drain holds the per-operation fetch lock across the whole loop
and therefore calls the non-locking `fetchChunkInternal`/`hasMoreRowsInternal`
primitives (calling the public `fetchChunk`/`hasMoreRows`, which re-acquire the
same lock, would self-deadlock). The existing unit test stubbed the *public*
methods, which the refactored drain no longer calls — so the stubs were bypassed,
the real internals ran with no data source, and the test timed out (2000ms).
Stub the internal primitives the drain actually invokes. Behavior asserted is
unchanged (fetchAll drains all chunks and returns all rows). Test is explicitly
implementation-specific (see its comment).
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent bec8a52 commit df3e568
1 file changed
Lines changed: 15 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1008 | 1008 | | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
1015 | 1023 | | |
1016 | 1024 | | |
1017 | 1025 | | |
1018 | 1026 | | |
1019 | 1027 | | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1025 | 1031 | | |
1026 | 1032 | | |
1027 | 1033 | | |
| |||
0 commit comments