Skip to content

graal IncubatingNotFoundApiTests assertion does not detect incubator API on classpath #8509

Description

@thswlsqls

Describe the bug

IncubatingNotFoundApiTests.incubatingApiIsNotFoundViaReflection() in integration-tests/graal does not verify the invariant its name claims. It asserts isInstanceOf(Logger/Tracer/LongCounterBuilder.class) on the noop instances, but the incubator Extended* noops subtype those stable types (ExtendedLogger extends Logger, ExtendedTracer extends Tracer, ExtendedLongCounterBuilder extends LongCounterBuilder). The assertions therefore stay true whether or not an incubator noop is returned, so the test would still pass if :api:incubator were wrongly added to the module's classpath — the regression it is meant to catch.

What did you expect to see?

The test should fail when an incubator noop (from io.opentelemetry.api.incubator.*) is returned, mirroring the sibling graal-incubating IncubatingApiTests.incubatingApiIsLoadedViaReflection(), which asserts the Extended* subtypes are present.

Additional context

The file was added by #6617 as the no-CCE safety net. The module does not depend on :api:incubator, so a fix has to assert on the runtime class package name rather than referencing the Extended* types directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions