Skip to content

Test harness fidelity: consumer retry, Fault<T>, and request timeout#246

Merged
Vulthil merged 2 commits into
mainfrom
feature/testharness-fidelity
Jun 18, 2026
Merged

Test harness fidelity: consumer retry, Fault<T>, and request timeout#246
Vulthil merged 2 commits into
mainfrom
feature/testharness-fidelity

Conversation

@Vulthil

@Vulthil Vulthil commented Jun 18, 2026

Copy link
Copy Markdown
Owner

What

Closes the Vulthil.Messaging.TestHarness fidelity gaps so behaviour verified against the in-memory harness matches real RabbitMQ.

TestHarness

  • Consumer retry — the one-way handler now applies the consumer's retry policy, looping attempts in a fresh DI scope each time (mirroring RabbitMqConsumerWorker, without the real back-off delays). A throwing consumer no longer propagates to the publisher.
  • Fault<T> emission — on retry exhaustion a Fault<TMessage> is published (captured and delivered in-process), so harness.Published<Fault<T>>() works.
  • Request timeout — a request with no consumer/responder now returns Messaging.Request.Timeout (matching the real requester), not Error.NotFound.
  • RetryCount / Redelivered — populated from the attempt number instead of hardcoded 0/false.

Behaviour changes (docs + tests updated): a one-way consumer that throws lets the publish/send succeed and emits a fault; a no-consumer request times out.

Messaging-core cleanups (first commit)

  • Removed the redundant IMessageConfigurationProvider.GetMessageConfiguration<T>() overload.
  • MessageContext.CorrelationId is now nullable, honouring the IMessageContext contract (dropped the ?? string.Empty coercion).

Tests

3 new TestHarness tests (fault emission, retry-with-incrementing-RetryCount recovery, no-consumer timeout); full TestHarness, core-messaging, and RabbitMq suites green locally (net9.0 + net10.0).

🤖 Generated with Claude Code

@Vulthil
Vulthil merged commit f5dcdcd into main Jun 18, 2026
5 checks passed
@Vulthil
Vulthil deleted the feature/testharness-fidelity branch June 18, 2026 20:12
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.

1 participant