From 946e63d810ba0d2a0235605a4116ad3acee33dd0 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Mon, 5 Oct 2026 04:22:18 -0400 Subject: [PATCH] [Fix] (MG_IntegrationTest): check pre-finish work completion in present credit tests --- .../MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp b/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp index b2b66392..74ac00b1 100644 --- a/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp +++ b/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp @@ -322,11 +322,14 @@ TEST_F(MagmaRunAheadScenario, PresentCreditActuallyParksTheClientAtItsConfigured Gl().EndFrame(); // credit + 1 must park before it can publish its present. stop.store(true); observer.join(); hold.Release(); EXPECT_TRUE(sawPark.load()) << "no real producer park while the present window was full"; + const auto issuedBeforeFinish = PeekSplitRuntime().emitSeq; glFinish(); const auto after=PeekSplitRuntime(); EXPECT_EQ(after.presentCreditWaits,before.presentCreditWaits+1); EXPECT_EQ(after.presentAckSerial,before.presentCredit+1); - EXPECT_EQ(after.appliedSeq,after.emitSeq); + // Finish waits for prior work, then asynchronously destroys its internal fence. + // That cleanup may still be queued when Finish returns. + EXPECT_GE(after.appliedSeq,issuedBeforeFinish); RecordProperty("observed_present_credit",std::to_string(before.presentCredit)); RecordProperty("observed_producer_park",sawPark.load() ? "yes" : "no"); }