From cebc677eb98e0b8cee9edfbcf4311d991d120013 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 17 Nov 2026 14:56:17 +0100 Subject: [PATCH] JFJochIntegrationTest_GPUStills_cancel_during_prepass: the frames are held for the pre-pass until the cancel With the mock the generator's 30 frames arrive at once and the run was over before the cancel. The case now gives the card fewer frames than the pre-pass waits for and no final packet, so the frames stay held, whatever the card's speed. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01UqXYdHHZ4cogS1mrGUtfN7 --- tests/JFJochReceiverProcessingTest.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/JFJochReceiverProcessingTest.cpp b/tests/JFJochReceiverProcessingTest.cpp index 68e4c5a4a..312a92dd5 100644 --- a/tests/JFJochReceiverProcessingTest.cpp +++ b/tests/JFJochReceiverProcessingTest.cpp @@ -254,9 +254,10 @@ TEST_CASE("JFJochIntegrationTest_GPUStills_cancel_during_prepass", "[JFJochRecei // A cancel while the frames are held for the pre-pass ends the collection. Logger logger(Catch::getResultCapture().getCurrentTestName()); + // Fewer frames arrive than the pre-pass waits for, and no final packet: the frames stay held until the cancel. // How long the stop takes is not checked. DiffractionExperiment experiment(DetJF4M()); - experiment.ImagesPerTrigger(30).NumTriggers(1).UseInternalPacketGenerator(true) + experiment.ImagesPerTrigger(30).NumTriggers(1).UseInternalPacketGenerator(false) .FilePrefix("gpu_stills_cancel").JungfrauConvPhotonCnt(false) .DetectorDistance_mm(75).BeamY_pxl(1136).BeamX_pxl(1090).IncidentEnergy_keV(12.4) .SetUnitCell(UnitCell{.a = 36.9, .b = 78.95, .c = 78.95, .alpha =90, .beta = 90, .gamma = 90}); @@ -264,7 +265,10 @@ TEST_CASE("JFJochIntegrationTest_GPUStills_cancel_during_prepass", "[JFJochRecei PixelMask pixel_mask(experiment); AcquisitionDeviceGroup aq_devices; - aq_devices.Add(std::make_unique(0, 64)); + auto test = std::make_unique(0, 64); + for (int m = 0; m < experiment.GetModulesNum(); m++) + test->CreateJFPackets(experiment, 1, 10, m, nullptr); + aq_devices.Add(std::move(test)); NonePusher pusher; JFJochReceiverService service(aq_devices, logger, pusher); @@ -273,7 +277,7 @@ TEST_CASE("JFJochIntegrationTest_GPUStills_cancel_during_prepass", "[JFJochRecei service.RugnuxLive(true, nullptr, 4, 60); service.Start(experiment, pixel_mask, nullptr); - std::this_thread::sleep_for(std::chrono::seconds(10)); + std::this_thread::sleep_for(std::chrono::seconds(3)); const auto t0 = std::chrono::steady_clock::now(); service.Cancel(false); JFJochReceiverOutput receiver_out;