From f55d107b9c7412d61745773a6f183db4bb9563b1 Mon Sep 17 00:00:00 2001 From: gibsondan Date: Sun, 12 Jan 2025 16:29:27 -0600 Subject: [PATCH] Add test case for step stats with a retry event before a step start event (#26973) Summary: This can happen if a step worker dies before the step starts. Not sure if what we are testing here is the desired behavior, but gives us a test case to change if we chagne the underlying behavior. ## Summary & Motivation ## How I Tested These Changes ## Changelog > Insert changelog entry or delete this section. --- .../storage_tests/utils/event_log_storage.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py b/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py index d73ceeb7bc336..977f7993d170e 100644 --- a/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py +++ b/python_modules/dagster/dagster_tests/storage_tests/utils/event_log_storage.py @@ -806,6 +806,16 @@ def test_event_log_get_stats_for_run( assert stats.start_time assert math.isclose(stats.start_time, start_time) + def test_event_log_step_stats_retry_with_no_start( + self, test_run_id: str, storage: EventLogStorage + ): + storage.store_event( + _event_record(test_run_id, "E", time.time() - 150, DagsterEventType.STEP_UP_FOR_RETRY), + ) + step_stats = storage.get_step_stats_for_run(test_run_id) + assert len(step_stats) == 1 + assert not step_stats[0].status + def test_event_log_step_stats( self, test_run_id: str,