Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Oct 14, 2024
1 parent 525a63d commit 253761c
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions python_modules/dagster/dagster_tests/daemon_tests/test_backfill.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,49 @@ def test_canceled_backfill(
assert instance.get_runs_count() == 1


def test_delete_backfill(
instance: DagsterInstance,
workspace_context: WorkspaceProcessContext,
remote_repo: RemoteRepository,
):
partition_set = remote_repo.get_partition_set("the_job_partition_set")
instance.add_backfill(
PartitionBackfill(
backfill_id="simple",
partition_set_origin=partition_set.get_remote_origin(),
status=BulkActionStatus.REQUESTED,
partition_names=["one", "two", "three"],
from_failure=False,
reexecution_steps=None,
tags=None,
backfill_timestamp=get_current_timestamp(),
)
)
assert instance.get_runs_count() == 0

next(
iter(
execute_backfill_iteration(
workspace_context, get_default_daemon_logger("BackfillDaemon")
)
)
)
assert instance.get_runs_count() == 1
backfill = instance.get_backfills()[0]
assert backfill.status == BulkActionStatus.REQUESTED
instance.update_backfill(backfill.with_status(BulkActionStatus.DELETING))
list(
iter(
execute_backfill_iteration(
workspace_context, get_default_daemon_logger("BackfillDaemon")
)
)
)
backfill = instance.get_backfill(backfill.backfill_id)
assert backfill is None
assert instance.get_runs_count() == 0


def test_failure_backfill(
instance: DagsterInstance,
workspace_context: WorkspaceProcessContext,
Expand Down

0 comments on commit 253761c

Please sign in to comment.