Skip to content

The agent that grows with you

test(cron): owner-scope stubs return an empty mapping, not None

Tekniumcf4fe4139f65
diff --git a/tests/cron/test_script_claim_heartbeat.py b/tests/cron/test_script_claim_heartbeat.py
index d03f3530ad2..207fa7993e2 100644
--- a/tests/cron/test_script_claim_heartbeat.py
+++ b/tests/cron/test_script_claim_heartbeat.py
@@ -355,7 +355,7 @@ def test_lost_fire_claim_stops_stale_delivery(monkeypatch):
monkeypatch.setattr(scheduler, "mark_job_run", mark_run)
with patch("agent.secret_scope.set_secret_scope", return_value=None), \
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None), \
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}), \
patch("agent.secret_scope.reset_secret_scope"):
assert scheduler.run_one_job(job) is True
@@ -413,7 +413,7 @@ def _run_claimed_job_with_mid_run_action(
claimed["execution_id"] = execution_id
with patch("agent.secret_scope.set_secret_scope", return_value=None), \
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None), \
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}), \
patch("agent.secret_scope.reset_secret_scope"):
assert scheduler.run_one_job(claimed) is expect_result
return delivered, finished
@@ -680,7 +680,7 @@ def test_terminal_owner_cas_failure_marks_ledger_ownership_lost(monkeypatch):
monkeypatch.setattr(scheduler, "finish_execution", finish)
with patch("agent.secret_scope.set_secret_scope", return_value=None), \
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None), \
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}), \
patch("agent.secret_scope.reset_secret_scope"):
assert scheduler.run_one_job(job) is True
diff --git a/tests/cron/test_shutdown_interrupt.py b/tests/cron/test_shutdown_interrupt.py
index 87ca1959bbb..070bd7c8adf 100644
--- a/tests/cron/test_shutdown_interrupt.py
+++ b/tests/cron/test_shutdown_interrupt.py
@@ -355,7 +355,7 @@ class TestExecutionScopedInterruption:
}
with patch("cron.scheduler.claim_dispatch", return_value=True), \
patch("agent.secret_scope.set_secret_scope", return_value=None), \
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None), \
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}), \
patch("agent.secret_scope.reset_secret_scope"), \
patch(
"cron.scheduler.run_job",
@@ -430,7 +430,7 @@ class TestBaseExceptionThroughOwnerFencedFlow:
return (
patch("cron.scheduler.claim_dispatch", return_value=True),
patch("agent.secret_scope.set_secret_scope", return_value=None),
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None),
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}),
patch("agent.secret_scope.reset_secret_scope"),
patch("cron.scheduler.run_job", side_effect=run_side_effect),
patch("cron.scheduler.heartbeat_fire_claim", return_value=True),
@@ -543,7 +543,7 @@ class TestRunOneJobHonoursInterruptedFlag:
with patch("cron.scheduler.claim_dispatch", return_value=True), \
patch("agent.secret_scope.set_secret_scope", return_value=None), \
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None), \
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}), \
patch("agent.secret_scope.reset_secret_scope"), \
patch(
"cron.scheduler.run_job",
@@ -578,7 +578,7 @@ class TestRunOneJobHonoursInterruptedFlag:
with patch("cron.scheduler.claim_dispatch", return_value=True), \
patch("agent.secret_scope.set_secret_scope", return_value=None), \
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None), \
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}), \
patch("agent.secret_scope.reset_secret_scope"), \
patch(
"cron.scheduler.run_job",
@@ -614,7 +614,7 @@ class TestRunOneJobHonoursInterruptedFlag:
with patch("cron.scheduler.claim_dispatch", return_value=True), \
patch("agent.secret_scope.set_secret_scope", return_value=None), \
- patch("agent.secret_scope.build_profile_secret_scope", return_value=None), \
+ patch("agent.secret_scope.build_profile_secret_scope", return_value={}), \
patch("agent.secret_scope.reset_secret_scope"), \
patch("cron.scheduler.run_job", side_effect=RuntimeError("boom")), \
patch("cron.scheduler.mark_job_run") as mock_mark: