Skip to content

Commit c8321e5

Browse files
committed
Fix some tests for the rerank operator.
1 parent 1e44a10 commit c8321e5

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/inference/RerankOperator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ public Page buildOutput() {
169169

170170
@Override
171171
public void close() {
172-
inputPage.allowPassingToDifferentDriver();
173-
inputPage.releaseBlocks();
174-
172+
releasePageOnAnyThread(inputPage);
175173
Releasables.closeExpectNoException(scoreBlockBuilder);
176174
}
177175

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/inference/RerankOperatorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private void initChannels() {
7171
scoreChannel = between(0, channelCount - 1);
7272
inputChannelElementTypes = IntStream.range(0, channelCount).sorted().mapToObj(this::randomElementType).collect(Collectors.toList());
7373
rowEncoderFactory = mockRowEncoderFactory();
74-
encodedRowLength = between(1, 10);
74+
encodedRowLength = between(1, 20);
7575
}
7676

7777
@Before
@@ -236,7 +236,7 @@ private XContentRowEncoder.Factory mockRowEncoderFactory() {
236236
XContentRowEncoder rowEncoder = mock(XContentRowEncoder.class);
237237
doAnswer(encoderInvocation -> {
238238
Page inputPage = encoderInvocation.getArgument(0, Page.class);
239-
BytesRef scratch = new BytesRef(randomRealisticUnicodeOfCodepointLength(encodedRowLength));
239+
BytesRef scratch = new BytesRef(randomAlphanumericOfLength(encodedRowLength));
240240
return driverContext.blockFactory().newConstantBytesRefBlockWith(scratch, inputPage.getPositionCount());
241241
}).when(rowEncoder).eval(any(Page.class));
242242

0 commit comments

Comments
 (0)