Skip to content

AsyncAPI 3.x: the problem type - #1751

Draft
LautaroPetaccio wants to merge 1 commit into
feature/asyncapi-driver-contractfrom
feature/asyncapi-problem-type
Draft

AsyncAPI 3.x: the problem type#1751
LautaroPetaccio wants to merge 1 commit into
feature/asyncapi-driver-contractfrom
feature/asyncapi-problem-type

Conversation

@LautaroPetaccio

Copy link
Copy Markdown
Collaborator

Tenth in the AsyncAPI stack, on top of #1738. Draft: the next two PRs — the sampler, then the fitness with the Guice module — complete it. Until they land, --problemType ASYNCAPI stops with a message saying exactly that, rather than a Guice stack trace.

What is here

  • ProblemType.ASYNCAPI, experimental like RPC, WEBFRONTEND and MCP, so nothing changes for anyone who does not ask for it.
  • Main: the type is inferred from SutInfoDto.asyncApiProblem when the driver declares one; the algorithm key is resolved over AsyncApiIndividual; the module branch throws the message above.
  • docs/options.md regenerated — ConfigToMarkdownTest keeps it honest.

The one decision: EMConfig.usesDriver()

Every other problem type reaches the EM Driver only in white-box mode, or in black-box experiments — and that rule was spelled out as !config.blackBox || config.bbExperiments in five places across Main and Statistics. AsyncAPI breaks it: there is no universal wire to a message-driven service, so the driver holds the broker connection even when the service itself is a black box (see #1738 for why).

Rather than add a third clause to five copies, the rule now lives once, in EMConfig.usesDriver(), and those five places ask it. Behaviour for every existing type is unchanged.

Two sets of guards were deliberately left alone:

  • the three in TestSuiteWriter, which decide whether the generated test instantiates a driver. That is a test-writer decision, and the AsyncAPI test writer is a later PR;
  • the black-box branches inside the REST, GraphQL and RPC samplers, which are each sampler's own business.

Not here

No @Cfg options yet — nothing so far has needed one. The reply timeout will arrive with the fitness, @Experimental like the rest.

Testing

EMConfigTest gains a test pinning usesDriver(): false for black-box REST, true for black-box AsyncAPI, true for white-box. EMConfigTest + ConfigToMarkdownTest: 111 tests, 0 failures.

ProblemType.ASYNCAPI, experimental like the other recent types. Main infers
it from SutInfoDto.asyncApiProblem, picks its algorithm key, and stops with
a clear message where the module will go: the sampler and fitness that
complete it are the next changes.

The one decision here is EMConfig.usesDriver(). Every other type reaches
the driver only in white-box mode, or in black-box experiments. An AsyncAPI
service has no universal wire to point at, so the driver holds the broker
connection even when the service is a black box. The places in Main and
Statistics that asked "is there a driver" now ask the config, instead of
each spelling the rule out.
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