Skip to content

test(agnocastlib): add CIE integration tests for dynamic callback groups#1264

Draft
atsushi421 wants to merge 1 commit intomainfrom
test/cie-dynamic-cbg
Draft

test(agnocastlib): add CIE integration tests for dynamic callback groups#1264
atsushi421 wants to merge 1 commit intomainfrom
test/cie-dynamic-cbg

Conversation

@atsushi421
Copy link
Copy Markdown
Collaborator

Description

Add integration tests for CallbackIsolatedAgnocastExecutor that verify the monitoring loop correctly handles callback groups created after spin() has started:

  • test_spin_publishes_callback_group_info: Existing test (from tier4/agnocast fork) verifying that CIE publishes CallbackGroupInfo for all callback groups present at spin time.
  • test_ros2_callback_group_added_after_spin: Creates a ROS callback group with a timer after spin(), verifies the monitoring loop detects it, spawns a child executor, publishes CallbackGroupInfo, and the timer callback executes.
  • test_agnocast_callback_group_added_after_spin: Creates an agnocast callback group with an agnocast subscription after spin(), verifies the monitoring loop detects it, spawns a SingleThreadedAgnocastExecutor, publishes CallbackGroupInfo, and the agnocast callback executes via mqueue.

Related links

How was this PR tested?

  • Autoware (required)
  • bash scripts/test/e2e_test_1to1.bash (required)
  • bash scripts/test/e2e_test_2to2.bash (required)
  • kunit tests (required when modifying the kernel module)
  • bash scripts/test/run_requires_kernel_module_tests.bash (required)
  • sample application

All 38 integration tests pass locally (including the 3 new CIE tests):

[  PASSED  ] 38 tests.

Notes for reviewers

These tests use the existing ioctl mock (test/integration/src/ioctl_mock.cpp) so they do not require the kernel module to run.

An important implementation note: callback groups created dynamically must be stored as member variables (SharedPtr) because NodeBase::callback_groups_ holds WeakPtr. If the callback group's only strong reference goes out of scope, the group is destroyed and the monitoring loop cannot detect it.

Version Update Label (Required)

need-patch-update — test-only addition, no production code changes.

Add integration tests for CallbackIsolatedAgnocastExecutor that verify
the monitoring loop correctly handles callback groups created after
spin() has started:

- test_ros2_callback_group_added_after_spin: creates a ROS callback
  group with a timer after spin, verifies the monitoring loop detects
  it, spawns a child executor, publishes CallbackGroupInfo, and the
  timer callback executes.

- test_agnocast_callback_group_added_after_spin: creates an agnocast
  callback group with an agnocast subscription after spin, verifies the
  monitoring loop detects it, spawns a SingleThreadedAgnocastExecutor,
  publishes CallbackGroupInfo, and the agnocast callback executes via
  mqueue.

Also includes the existing test_spin_publishes_callback_group_info test
that was previously only in the tier4/agnocast fork.

Signed-off-by: atsushi421 <atsushi.yano.2@tier4.jp>
@atsushi421 atsushi421 added the need-patch-update Bug fixes and other changes - requires PATCH version update label Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-patch-update Bug fixes and other changes - requires PATCH version update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant