elsa-core/test/component/Elsa.Workflows.ComponentTests/Scenarios
Sipke Schoorstra a02ebff129
test: fix two intermittent test failures (#7957) (#7965)
Both tests read a value that is usually one thing and occasionally
another, with a race deciding which.

ReloadTests: EndpointSecurityOptions.SecurityIsEnabled is a process-
global static, and ShellsApiTestBase saved/set/restored it per test
method. ReloadTests and ReloadAllTests carry no [Collection], so xUnit
runs them in parallel. FastEndpoints reads that global once per host
while UseFastEndpoints() configures the endpoints, so when one class's
DisposeAsync restores true inside another class's set-false ->
UseFastEndpoints() window, that host's endpoints get authorization
metadata in a pipeline with no UseAuthorization, and every request to
them throws. Every test in the assembly wants security off, so set it
once in a module initializer and stop mutating it per test.

PublishEvent_WithPayload_TransmitsPayloadToConsumer: the payload's
representation is not stable. While it is still the original CLR object
its properties are PascalCase; once it has been through
JsonWorkflowStateSerializer it is an ExpandoObject whose keys were
camelCased by that serializer's naming policy. Which one the test sees
depends on whether GetSingleWorkflowInstanceAsync returned the live
in-memory instance or one read back from the store, and TryGetProperty
is case-sensitive. Assert the payload's content through a DTO with
PropertyNameCaseInsensitive instead of one of the two representations.

Also require a terminal instance at both exits of
GetSingleWorkflowInstanceAsync: it accepted any save, and an instance is
saved several times over its lifetime, so it could hand a caller that
asserts Finished an instance that is still running.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 23:30:38 +02:00
..
Activities test: fix two intermittent test failures (#7957) (#7965) 2026-08-20 23:30:38 +02:00
BasicWorkflows Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
CachingAndWorkflowDefinitionActivity Fix semaphore release logic in scheduled task execution (#7045) 2025-11-09 14:14:25 +01:00
ClusteredHosting Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
ConcurrentTriggerIndexing Refactor ConcurrentTriggerIndexingTests: simplify concurrency logic and remove redundant methods. 2026-02-21 16:13:33 +01:00
DistributedLockResilience Fix Multitenancy Support and Normalize Tenant ID Handling (#7217) 2026-01-30 19:54:13 +01:00
Extensions Removed unnecessary tests, small refactors for readability +organization 2025-12-03 11:48:53 +01:00
HostMethodActivities Adds activity host registration support (#7172) 2025-12-27 20:52:52 +01:00
HttpWorkflows Fix route data handling (#6176) 2024-12-04 11:31:03 +01:00
InputOutput Add synthetic properties to JS engine for exclusion (#6178) 2024-12-05 09:30:31 +01:00
JavaScriptVariables Update all dependencies to new projects. 2025-05-21 00:20:13 +01:00
LogPersistenceModes Skip flaky test in InputOutputLoggingTests. 2025-05-20 11:41:00 +02:00
Multitenancy [codex] Resolve build warnings (#7458) 2026-05-17 14:58:10 +02:00
OutputConverters Add output converter support at binding boundaries 2026-07-31 04:10:48 +02:00
RestApis Add bookmark queue dead-letter store (#7516) 2026-05-21 23:43:36 +02:00
TriggerIndexingIdempotency Add idempotency tests for trigger indexing and fix serialization mismatch in WorkflowTriggerEqualityComparer 2026-02-24 15:05:58 +01:00
Variables Add extensive unit and component tests for scheduling activities (#7036) 2025-11-07 21:54:50 +01:00
VariablesArray Added IEnumerableTypeConverter (#7020) 2025-11-12 11:07:33 +01:00
WorkflowActivities Add shell middleware, call‑stack tracking, and workflow reference graph APIs (#7333) 2026-02-28 21:16:04 +01:00
WorkflowCompletion Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
WorkflowDefinitionExport Expose consumers API and recursive export option (#7309) 2026-02-20 17:40:47 +01:00
WorkflowDefinitionRefresh Add distributed workflow runtime implementation. 2025-06-03 09:58:20 +02:00
WorkflowDefinitionReload [codex] Resolve build warnings (#7458) 2026-05-17 14:58:10 +02:00
WorkflowInstanceDeletion Improves workflow deletion and task scheduling (#7088) 2025-11-21 20:58:38 +01:00
WorkflowJsonStructures Add ExecuteWorkflow activity (#6134) 2024-11-21 16:44:25 +01:00
WorkflowReferenceGraph Expose consumers API and recursive export option (#7309) 2026-02-20 17:40:47 +01:00