Skip to content

[BUG] test_openapi_contract asserts before the gateway has discovered the demo node's operations #697

Description

@bburda

Bug report

test_a_scoped_item_says_what_its_templated_sibling_says in src/ros2_medkit_integration_tests/test/features/test_openapi_contract.test.py asserts that at least one item of each collection carried x-sovd-name, so that the comparison it makes is not vacuous. For operations that item exists only after the gateway has discovered the demo node's services.

The suite does not wait for that. spec() fetches /docs as soon as the answer has an openapi key, which the gateway serves before discovery has run. On a loaded runner the document can still be free of operations at that moment, and the test fails with

AssertionError: 0 not greater than 0 : no operations sub-document published a cache-derived item
(none carried x-sovd-name); every comparison over operations was vacuous

Steps to reproduce

  1. Run colcon test --packages-select ros2_medkit_integration_tests --ctest-args -R test_openapi_contract on a machine under load.
  2. Repeat until the gateway answers /docs before the demo node's services are in the cache.

Expected behavior

The test waits until the gateway has the operations it is about to compare, then asserts.

Actual behavior

The test asserts against whatever the gateway had at the first answer, and fails when discovery had not finished.

Environment

  • ros2_medkit version: main
  • ROS 2 distro: jazzy
  • OS: Ubuntu 24.04

Additional information

Seen on a CI run of the jazzy-test job; the same job passed on a re-run of the same commit. The guard that reports the vacuous comparison is doing its job: the document really had no operation to compare. The precondition is what needs to change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions