From a5043308f24c72d7c534e1af36be749c7cbb38a9 Mon Sep 17 00:00:00 2001 From: Christoph Neuhauser Date: Mon, 4 Aug 2025 08:54:10 +0200 Subject: [PATCH] Fix: Tests: Avoid RecursionError in EEVEE performance tests The EEVEE performance tests call scene.frame_set at the end of the warmup stage, which recursively calls frame_change_handler. Eventually, this leads to a RecursionError. This PR adds a guard for checking if frame_set is currently active and returns early for this recursive call of the function. Pull Request: https://projects.blender.org/blender/blender/pulls/143203 --- tests/performance/tests/eevee.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/performance/tests/eevee.py b/tests/performance/tests/eevee.py index 33ee0c6a6e6..275d01ae098 100644 --- a/tests/performance/tests/eevee.py +++ b/tests/performance/tests/eevee.py @@ -36,6 +36,7 @@ def frame_change_handler(scene): import bpy global record_stage + global frame_set_mode global start_time global start_record_time global start_warmup_time @@ -47,6 +48,7 @@ def frame_change_handler(scene): if record_stage == RecordStage.INIT: screen = bpy.context.window_manager.windows[0].screen bpy.context.scene.sync_mode = 'NONE' + frame_set_mode = False for area in screen.areas: if area.type == 'VIEW_3D': @@ -71,6 +73,10 @@ def frame_change_handler(scene): record_stage = RecordStage.WARMUP elif record_stage == RecordStage.WARMUP: + if frame_set_mode: + # scene.frame_set results in a recursive call to frame_change_handler. + # Avoid running into a RecursionError. + return warmup_frame += 1 # Check for two-stage shader compilation that can happen later than the first frame. if hasattr(bpy.app, 'is_job_running') and bpy.app.is_job_running("SHADER_COMPILATION"): @@ -80,7 +86,9 @@ def frame_change_handler(scene): playback_iteration = 0 num_frames = 0 scene = bpy.context.scene + frame_set_mode = True scene.frame_set(scene.frame_start) + frame_set_mode = False record_stage = RecordStage.RECORD elif record_stage == RecordStage.RECORD: