**Build scan:**
https://gradle-enterprise.elastic.co/s/7vcre2by7feoe/tests/:server:internalClusterTest/org.elasticsearch.search.aggregations.bucket.SignificantTermsSignificanceScoreIT/testScriptScore

**Reproduction line:**
```
./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.search.aggregations.bucket.SignificantTermsSignificanceScoreIT.testScriptScore" -Dtests.seed=3AF8B75C5D0AD4EA -Dtests.locale=es-PR -Dtests.timezone=EAT -Druntime.java=20
```

**Applicable branches:**
main

**Reproduces locally?:**
Yes

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.search.aggregations.bucket.SignificantTermsSignificanceScoreIT&tests.test=testScriptScore

**Failure excerpt:**
```
java.lang.Exception: Test abandoned because suite timeout was reached.

  at __randomizedtesting.SeedInfo.seed([3AF8B75C5D0AD4EA]:0)

```
server/src/main/java/org/elasticsearch/search/aggregations/bucket/terms/SignificanceLookup.java
long freq(long term) throws IOException;
    }
    private final AggregationContext context;
    private final MappedFieldType fieldType;
    private final DocValueFormat format;
    private final Query backgroundFilter;
    private final int supersetNumDocs;
    private TermsEnum termsEnum;
    SignificanceLookup(
        AggregationContext context,
        SamplingContext samplingContext,
        MappedFieldType fieldType,
        DocValueFormat format,
        QueryBuilder backgroundFilter
    ) throws IOException {
        this.context = context;
        this.fieldType = fieldType;
        this.format = format;
        
        
        
        Query backgroundQuery = backgroundFilter == null
            ? samplingContext.buildSamplingQueryIfNecessary(context).orElse(null)
            : samplingContext.buildQueryWithSampler(backgroundFilter, context);
        
        if (backgroundQuery == null) {
            Query matchAllDocsQuery = new MatchAllDocsQuery();
            Query contextFiltered = context.filterQuery(matchAllDocsQuery);