Skip to content

Add Context.IsReplaying E2E tests#3356

Open
andystaples wants to merge 12 commits intodevfrom
andystaples/add-is-replaying-tests
Open

Add Context.IsReplaying E2E tests#3356
andystaples wants to merge 12 commits intodevfrom
andystaples/add-is-replaying-tests

Conversation

@andystaples
Copy link
Collaborator

@andystaples andystaples commented Feb 23, 2026

Summary

What changed?

  • Adds E2E tests that verify the behavior of orchestration context.IsReplaying across all relevant languages/backends
  • Also makes an improvement across the E2E tests to use polling-based log detection

Why is this change needed?

  • Bug found in Python, see linked work item

Issues / work items


Project checklist

  • Documentation changes are not required
    • Otherwise: Documentation PR is ready to merge and referenced in pending_docs.md
  • Release notes are not required for the next release
    • Otherwise: Notes added to release_notes.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • No extra work is required to be leveraged by OutOfProc SDKs
    • Otherwise: Work tracked here: #issue_or_pr_in_each_sdk
  • No change to the version of the WebJobs.Extensions.DurableTask package
    • Otherwise: Major/minor updates are reflected in /src/Worker.Extensions.DurableTask/AssemblyInfo.cs
  • No EventIds were added to EventSource logs
  • This change should be added to the v2.x branch
    • Otherwise: This change applies exclusively to WebJobs.Extensions.DurableTask v3.x and will be retained only in the dev and main branches
  • Breaking change?
    • If yes:
      • Impact:
      • Migration guidance:

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s): VS Copilot
  • AI-assisted areas/files: All
  • What you changed after AI output: Fixed test skip attributes and small syntactic errors

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Testing

Automated tests

  • Result: Passed / Failed (link logs if failed)

Manual validation (only if runtime/behavior changed)

  • Environment (OS, .NET version, components):
  • Steps + observed results:
    1.
    2.
    3.
  • Evidence (optional):

Notes for reviewers

  • N/A

Copilot AI review requested due to automatic review settings February 23, 2026 19:54
@andystaples andystaples changed the title Initial implementation Add Context.IsReplaying E2E tests Feb 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds new E2E coverage to validate context.IsReplaying/equivalent behavior across non-.NET languages/backends, by introducing a new test suite plus language-specific orchestrators/activities that emit replay-state snapshots and log markers.

Changes:

  • Adds a new IsReplayingTests test class validating replay flags, snapshot progression, counters, conditional logging, and fan-out/fan-in behavior.
  • Adds IsReplaying* orchestrations + an echo activity to the Python, PowerShell, Node, and Java E2E apps to provide consistent test inputs/outputs.
  • Updates test.runsettings defaults (currently committed, but the file indicates it should not be).

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/e2e/Tests/test.runsettings Changes local default E2E language/app selection (should remain unmodified in repo).
test/e2e/Tests/Tests/IsReplayingTests.cs New E2E test suite asserting replay-state semantics via orchestration outputs and host logs.
test/e2e/Apps/BasicPython/is_replaying_checks.py Adds Python durable orchestrations/activities that record context.is_replaying at key checkpoints.
test/e2e/Apps/BasicPython/function_app.py Registers the new Python blueprint so the functions are discoverable by the host.
test/e2e/Apps/BasicPowerShell/IsReplayingMultiActivity/run.ps1 Adds PowerShell multi-activity orchestration that records replay snapshots.
test/e2e/Apps/BasicPowerShell/IsReplayingMultiActivity/function.json Binds the PowerShell multi-activity orchestrator to an orchestration trigger.
test/e2e/Apps/BasicPowerShell/IsReplayingFanOutFanIn/run.ps1 Adds PowerShell fan-out/fan-in orchestration to validate replay flags around parallel tasks.
test/e2e/Apps/BasicPowerShell/IsReplayingFanOutFanIn/function.json Binds the PowerShell fan-out/fan-in orchestrator to an orchestration trigger.
test/e2e/Apps/BasicPowerShell/IsReplayingEcho/run.ps1 Adds PowerShell echo activity used by the replay-check orchestrations.
test/e2e/Apps/BasicPowerShell/IsReplayingEcho/function.json Binds the PowerShell echo activity to an activity trigger.
test/e2e/Apps/BasicPowerShell/IsReplayingCounter/run.ps1 Adds PowerShell orchestration that counts replay vs non-replay checkpoints.
test/e2e/Apps/BasicPowerShell/IsReplayingCounter/function.json Binds the PowerShell counter orchestrator to an orchestration trigger.
test/e2e/Apps/BasicPowerShell/IsReplayingConditionalLog/run.ps1 Adds PowerShell orchestration that logs different markers on replay vs live paths.
test/e2e/Apps/BasicPowerShell/IsReplayingConditionalLog/function.json Binds the PowerShell conditional-log orchestrator to an orchestration trigger.
test/e2e/Apps/BasicPowerShell/IsReplayingBasic/run.ps1 Adds PowerShell “basic” orchestration that captures replay flags before/after a single activity.
test/e2e/Apps/BasicPowerShell/IsReplayingBasic/function.json Binds the PowerShell basic orchestrator to an orchestration trigger.
test/e2e/Apps/BasicNode/src/functions/IsReplayingChecks.ts Adds Node durable orchestrations/activities mirroring the replay-check scenarios.
test/e2e/Apps/BasicJava/src/main/java/com/function/IsReplayingChecks.java Adds Java durable orchestrations/activities mirroring the replay-check scenarios (includes workaround for a known serialization issue).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…Checks.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 23, 2026 20:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 23, 2026 22:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 23, 2026 22:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 25, 2026 18:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 25, 2026 19:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -2,9 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Collections.Concurrent;
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The using Xunit.Sdk; directive was removed, but DiagnosticMessage on line 75 is from the Xunit.Sdk namespace. With implicit usings enabled, Xunit.Sdk is not automatically included, which will cause a compilation error. The using directive should be restored.

Suggested change
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using Xunit.Sdk;

Copilot uses AI. Check for mistakes.
@@ -2,9 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Collections.Concurrent;
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The using Microsoft.Extensions.Logging; directive was removed, but types from this namespace (ILoggerProvider, ILogger, LogLevel, EventId) are used in this file (lines 8, 67, 72). Other files in the same project (e.g., FunctionAppFixture.cs, FixtureHelpers.cs) explicitly import this namespace, indicating it's not part of implicit usings. This will cause a compilation error. The using directive should be restored.

Suggested change
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using Microsoft.Extensions.Logging;

Copilot uses AI. Check for mistakes.
@@ -2,9 +2,6 @@
// Licensed under the MIT License. See License.txt in the project root for license information.

using System.Collections.Concurrent;
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The using Xunit.Abstractions; directive was removed, but types from this namespace (ITestOutputHelper, IMessageSink) are used in this file (lines 10-11, 14, 46). Other files in the same project (e.g., FunctionAppFixture.cs, FunctionAppProcess.cs) explicitly import this namespace, indicating it's not part of implicit usings. This will cause a compilation error. The using directive should be restored.

Suggested change
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using Xunit.Abstractions;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add E2E tests covering context.IsReplaying() across all languages/backends

3 participants