Skip to content

Commit 335adcc

Browse files
committed
Stabilize scheduled entity E2E timing
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b872ac61-5bac-40e3-b9c7-daf295725fde
1 parent 093df8c commit 335adcc

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎tests/azure-functions-durable/e2e/apps/dtask_style/host.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
"extensions": {
1313
"durableTask": {
1414
"storageProvider": {
15-
"type": "AzureStorage",
16-
"maxQueuePollingInterval": "00:00:01"
15+
"type": "AzureStorage"
1716
}
1817
}
1918
}

‎tests/azure-functions-durable/e2e/apps/dtask_style/orchestrators.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ def signal_counter_delayed(ctx: task.OrchestrationContext, key: Any):
193193
# Schedules a delayed (future) signal to the counter entity, then completes
194194
# immediately. The signal should only be delivered after the delay elapses.
195195
entity_id = entities.EntityInstanceId("counter", key)
196-
signal_at = ctx.current_utc_datetime + timedelta(seconds=3)
196+
# Azure Queue visibility delays have one-second precision. The fractional
197+
# offset keeps normal dispatch within Core's 100 ms early-delivery window.
198+
signal_at = ctx.current_utc_datetime + timedelta(seconds=3.1)
197199
ctx.signal_entity(entity_id, "add", 4, signal_time=signal_at)
198200
return key
199201

‎tests/azure-functions-durable/e2e/test_dtask_entities_advanced_e2e.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ def test_call_failing_entity_handled(dtask_app):
8282

8383
def test_client_delayed_signal_is_deferred(dtask_app):
8484
key = f"client-delay-{int(time.time() * 1000)}"
85-
# Schedule the signal ~3s in the future.
86-
dtask_app.signal_entity("counter", key, "add", input=9, delay_seconds=3)
85+
# The fractional offset accounts for Azure Queue's one-second visibility
86+
# precision and keeps dispatch within Core's 100 ms early-delivery window.
87+
dtask_app.signal_entity("counter", key, "add", input=9, delay_seconds=3.1)
8788

8889
# It must not be delivered immediately.
8990
time.sleep(1)

0 commit comments

Comments
 (0)