Skip to content

Test Generator: CollectionName is ignored by Sync outbox templates, so sync tests are never serialised #4239

Closed

Description

@iancooper

Summary

OutboxConfiguration.CollectionName is intended to render an xUnit [Collection(...)] attribute so tests sharing infrastructure do not run concurrently. It is honoured by the Async outbox templates but not by any of the Sync ones, so the generated sync outbox tests carry no [Collection] and can run in parallel against the same store.

Evidence

From tools/Paramore.Brighter.Test.Generator/Templates:

$ grep -rl "CollectionName" Templates/Outbox/Async/ | wc -l
12
$ grep -rl "CollectionName" Templates/Outbox/Sync/ | wc -l
0

The messaging gateway templates (Reactor/ and Proactor/) both honour it, so the outbox Sync set is the odd one out.

Configs that set CollectionName on an outbox and are silently getting no serialisation on their sync tests include tests/Paramore.Brighter.MySQL.Tests/test-configuration.json (MySQLTextOutbox, MySQLBinaryOutbox) and the MSSQL/PostgreSQL equivalents.

Impact

A likely source of CI flakiness: two sync outbox test classes over the same store can interleave. It would also be masked today wherever the outbox is configured with the singular Outbox form, since no sync tests are generated at all (see the sibling issue on that).

Expected

The Sync outbox templates should emit [Collection(...)] the same way the Async ones do:

{% if CollectionName != null %}[Collection("{{CollectionName}}")]{% endif %}

Suggested fix

Add the conditional to the 12 templates in Templates/Outbox/Sync/, then regenerate all projects with ./generate-test.sh.

Notes

Found while documenting the generator for docs/factories/tests, where the gap is currently noted as a known defect.

Activity

  1. self-assigned this
    on Jul 17, 2026
  2. added
    .NETPull requests that update .net code
    MaintenanceBuild, CI, refactoring, testing infrastructure, and other chores
    on Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

.NETPull requests that update .net codeBugMaintenanceBuild, CI, refactoring, testing infrastructure, and other choresV10.X

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions