Commit d76ef16
Fix Windows path split in orphan-tail drainer test
testPreAdoptionSetupFailureDoesNotQuarantineTheSlot derived the slot's
parent directory with slotPath.substring(0, slotPath.lastIndexOf('/')).
File.getAbsolutePath() yields '\' separators on Windows, so lastIndexOf
returned -1 and substring threw StringIndexOutOfBoundsException before
the test reached a single assertion. It was the only failure in the
Windows CI run (2684 tests, 1 error).
Paths.get(slotPath).getParent() derives the parent portably. The join
stays a forward slash on purpose: SlotLock.resolveLogicalLock builds the
lock directory as parentPath + "/" + ".slot-locks", and the blocking
file this test plants must land on the exact string acquireLogical will
mkdir. Deriving the whole path through Paths.get would yield
'\.slot-locks' on Windows, putting the file where acquireLogical never
looks, so the test would pass while exercising nothing. SlotLockTest
already documents that trap for its sibling.
Verified both ways on macOS: the test passes with this change, and still
fails with "a slot this drainer never adopted must not be quarantined"
when the BackgroundDrainer engine != null guard it pins is reverted.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 54cb19d commit d76ef16
1 file changed
Lines changed: 7 additions & 1 deletion
File tree
- core/src/test/java/io/questdb/client/test/cutlass/qwp/client/sf/cursor
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
| |||
0 commit comments