@@ -909,6 +909,30 @@ HWTEST_F(EnqueueKernelTest, givenCommandStreamReceiverInBatchingModeWhenFlushIsC
909909 EXPECT_EQ (1 , mockCsr->flushCalledCount );
910910}
911911
912+ HWCMDTEST_F (IGFX_XE_HP_CORE, EnqueueKernelTest, givenTwoEnqueueProgrammedWithinSameCommandBufferWhenBatchedThenNoBBSBetweenThem) {
913+ auto mockCsr = new MockCsrHw2<FamilyType>(*pDevice->executionEnvironment , pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ());
914+ mockCsr->overrideDispatchPolicy (DispatchMode::BatchedDispatch);
915+ mockCsr->useNewResourceImplicitFlush = false ;
916+ mockCsr->useGpuIdleImplicitFlush = false ;
917+ pDevice->resetCommandStreamReceiver (mockCsr);
918+
919+ auto mockedSubmissionsAggregator = new mockSubmissionsAggregator ();
920+ mockCsr->overrideSubmissionAggregator (mockedSubmissionsAggregator);
921+
922+ HardwareParse hwParse;
923+
924+ MockKernelWithInternals mockKernel (*pClDevice);
925+ size_t gws[3 ] = {1 , 0 , 0 };
926+ pCmdQ->enqueueKernel (mockKernel.mockKernel , 1 , nullptr , gws, nullptr , 0 , nullptr , nullptr );
927+ pCmdQ->enqueueKernel (mockKernel.mockKernel , 1 , nullptr , gws, nullptr , 0 , nullptr , nullptr );
928+ pCmdQ->flush ();
929+
930+ hwParse.parseCommands <FamilyType>(*pCmdQ);
931+ auto bbsCommands = findAll<typename FamilyType::MI_BATCH_BUFFER_START *>(hwParse.cmdList .begin (), hwParse.cmdList .end ());
932+
933+ EXPECT_EQ (bbsCommands.size (), 1u );
934+ }
935+
912936HWTEST_F (EnqueueKernelTest, givenCsrInBatchingModeWhenFinishIsCalledThenBatchesSubmissionsAreFlushed) {
913937 auto mockCsr = new MockCsrHw2<FamilyType>(*pDevice->executionEnvironment , pDevice->getRootDeviceIndex (), pDevice->getDeviceBitfield ());
914938 mockCsr->overrideDispatchPolicy (DispatchMode::BatchedDispatch);
0 commit comments