**Build scan:**
https://gradle-enterprise.elastic.co/s/fvg2knbi424p4/tests/:x-pack:plugin:esql:test/org.elasticsearch.xpack.esql.expression.function.scalar.conditional.LeastTests/testEvaluateInManyThreads%20%7BTestCase=(%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E)%20null%20in%204%7D
**Reproduction lines:**
```
gradlew ':x-pack:plugin:esql:test' --tests "org.elasticsearch.xpack.esql.expression.function.scalar.conditional.GreatestTests.testEvaluateInManyThreads {TestCase=(<mv_integer>) null in 0}" -Dtests.seed=BCCD8A2AFCEA37CB -Dtests.locale=zh -Dtests.timezone=Europe/Guernsey -Druntime.java=21

gradlew ':x-pack:plugin:esql:test' --tests "org.elasticsearch.xpack.esql.expression.function.scalar.conditional.LeastTests.testEvaluateInManyThreads {TestCase=(<keyword>, <keyword>, <keyword>, <keyword>, <keyword>, <keyword>, <keyword>) null in 4}" -Dtests.seed=BCCD8A2AFCEA37CB -Dtests.locale=lt -Dtests.timezone=Indian/Christmas -Druntime.java=21

 gradlew ':x-pack:plugin:esql:test' --tests "org.elasticsearch.xpack.esql.expression.function.scalar.conditional.GreatestTests.testEvaluateInManyThreads {TestCase=(<mv_integer>) null in 0}" -Dtests.seed=BCCD8A2AFCEA37CB -Dtests.locale=zh -Dtests.timezone=Europe/Guernsey -Druntime.java=21
```

**Applicable branches:**
main

**Reproduces locally?:**
Yes

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.xpack.esql.expression.function.scalar.conditional.LeastTests&tests.test=testEvaluateInManyThreads%20%7BTestCase%3D(%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E,%20%3Ckeyword%3E)%20null%20in%204%7D


**Failure excerpt:**
```
org.elasticsearch.xpack.esql.expression.function.scalar.conditional.GreatestTests > classMethod FAILED
    java.lang.AssertionError: expected:<[boolean, double, integer, ip, keyword, long, text, version]> but was:<[integer]>


```
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java
private final List<CircuitBreaker> breakers = Collections.synchronizedList(new ArrayList<>());
    protected final DriverContext driverContext() {
        MockBigArrays bigArrays = new MockBigArrays(PageCacheRecycler.NON_RECYCLING_INSTANCE, ByteSizeValue.ofGb(1));
        CircuitBreaker breaker = bigArrays.breakerService().getBreaker(CircuitBreaker.REQUEST);
        breakers.add(breaker);
        return new DriverContext(bigArrays.withCircuitBreaking(), new BlockFactory(breaker, bigArrays));
    }
    protected final DriverContext crankyContext() {
        BigArrays bigArrays = new MockBigArrays(PageCacheRecycler.NON_RECYCLING_INSTANCE, new CrankyCircuitBreakerService());
        CircuitBreaker breaker = bigArrays.breakerService().getBreaker(CircuitBreaker.REQUEST);
        breakers.add(breaker);
        return new DriverContext(bigArrays.withCircuitBreaking(), new BlockFactory(breaker, bigArrays));
    }
    @After
    public void allMemoryReleased() {
        for (CircuitBreaker breaker : breakers) {
            assertThat(breaker.getUsed(), equalTo(0L));
        }
    }
    static Version randomVersion() {
        
        return switch (between(0, 2)) {
            case 0 -> new Version(Integer.toString(between(0, 100)));
            case 1 -> new Version(between(0, 100) + "." + between(0, 100));
            case 2 -> new Version(between(0, 100) + "." + between(0, 100) + "." + between(0, 100));
            default -> throw new IllegalArgumentException();
        };
    }
}