@@ -437,7 +437,12 @@ public Iterable<MappedFieldType> dimensionFields() {
437437 () -> query ,
438438 null ,
439439 maxBucket ,
440- () -> buildSubSearchContext (indexSettings , searchExecutionContext , bitsetFilterCache ),
440+ () -> buildSubSearchContext (
441+ indexSettings ,
442+ searchExecutionContext ,
443+ bitsetFilterCache ,
444+ breakerService .getBreaker (CircuitBreaker .REQUEST )
445+ ),
441446 bitsetFilterCache ,
442447 randomInt (),
443448 () -> 0L ,
@@ -471,7 +476,8 @@ protected List<ObjectMapper> objectMappers() {
471476 private SubSearchContext buildSubSearchContext (
472477 IndexSettings indexSettings ,
473478 SearchExecutionContext searchExecutionContext ,
474- BitsetFilterCache bitsetFilterCache
479+ BitsetFilterCache bitsetFilterCache ,
480+ CircuitBreaker breaker
475481 ) {
476482 SearchContext ctx = mock (SearchContext .class );
477483 try {
@@ -488,7 +494,8 @@ private SubSearchContext buildSubSearchContext(
488494 throw new RuntimeException (e );
489495 }
490496 when (ctx .fetchPhase ()).thenReturn (new FetchPhase (Arrays .asList (new FetchSourcePhase (), new FetchDocValuesPhase ())));
491-
497+ when (ctx .circuitBreaker ()).thenReturn (breaker );
498+ when (ctx .memAccountingBufferSize ()).thenReturn (1024 * 1024L );
492499 /*
493500 * Use a QueryShardContext that doesn't contain nested documents so we
494501 * don't try to fetch them which would require mocking a whole menagerie
0 commit comments