Skip to content

Commit

Permalink
Add test case for step stats with a retry event before a step start e…
Browse files Browse the repository at this point in the history
…vent (#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.
  • Loading branch information
gibsondan authored Jan 12, 2025
1 parent fcc708f commit f55d107
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f55d107

Please sign in to comment.