Skip to content

Commit 3f8af61

Browse files
committed
Update docs regarding IDisposable and IAsyncDisposable support.
1 parent af95fa3 commit 3f8af61

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

docs/automation/context-injection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ To use context injection:
1111
Rules:
1212

1313
* The life-time of these objects is limited to a scenario's execution.
14-
* If the injected objects implement `IDisposable`, they will be disposed after the scenario is executed.
14+
* If the injected objects implement `IDisposable` or `IAsyncDisposable`, they will be disposed after the scenario is executed. If they implement both, only `DisposeAsync` will be called.
1515
* The injection is resolved recursively, i.e. the injected class can also have dependencies.
1616
* Resolution is done using public constructors only.
1717
* If there are multiple public constructors, Reqnroll takes the first one.

docs/execution/parallel-execution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ When using Reqnroll we can consider the parallel scheduling on the level of scen
4848
* However, if you still want to use method-level parallelism and a `FeatureContext` in your test suite, then **the following things will be true**:
4949
* The `FeatureContext` and feature-level DI container will remain consistent **per feature, per test thread**. This means that anything you register in the feature container will be resolvable in the `[AfterFeature]` **per test thread**.
5050
* A given `[BeforeFeature]` or `[AfterFeature]` will only be executed once **per test thread** that runs a scenario of a feature.
51-
* Types you register in the feature-level DI container that implement `IDisposable` will still be disposed **per feature, per test thread**. (Keep this in mind if you try to work around this parallelism behavior to regain singleton-like behavior. E.g. by using static instances, `Lazy<>`, thread-safe collections, etc.)
51+
* Types you register in the feature-level DI container that implement `IDisposable` or `IAsyncDisposable` will still be disposed **per feature, per test thread**. (Keep this in mind if you try to work around this parallelism behavior to regain singleton-like behavior. E.g. by using static instances, `Lazy<>`, thread-safe collections, etc.)
5252
* Scenarios and their related hooks (Before/After scenario, scenario block, step) are isolated in the different threads during execution and do not block each other. Each thread has a separate (and isolated) `ScenarioContext`.
5353
* The test trace listener (that outputs the scenario execution trace to the console by default) is invoked asynchronously from the multiple threads and the trace messages are queued and passed to the listener in serialized form. If the test trace listener implements `Reqnroll.Tracing.IThreadSafeTraceListener`, the messages are sent directly from the threads.
5454

0 commit comments

Comments
 (0)