Skip to content

Ensure .NET harness stops workers when features return null or throw #936

Closed

Description

@yuandrew

Codex helped spot a small cleanup issue with our .NET harness

Runner.RunAsync skips worker cleanup when ExecuteAsync returns null or when execution, result checks, or history checks throw. This leaves the worker polling while subsequent features run. This doesn't make sense for things like Standalone Activity, since there is no workflow handle to return, so they would either need to call a dummy workflow to get a handle, or manually call StopWorker() themselves.

Returning null is supported by IFeature.ExecuteAsync to skip workflow result and history checks. schedule/duplicate_error and the standalone activity feature in #934 both use this.

We should move cleanup into a finally block using StopWorker(). This should also work for features that explicitly stop or restart their worker. If cleanup throws, we should make sure to preserve the original test failure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions