Skip to content

πŸ‘¨β€πŸŒΎ test_generate_policy and test_generate_service flaky on macOS on foxyΒ #251

@azeey

Description

@azeey

Bug report

Required Info:

  • Operating System:
    • macOs
  • Installation type:
    • source
  • Version or commit hash:
    • 0.9.4
  • DDS implementation:
    • N/A
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

test_generate_policy or test_generate_service tests fail consistently if ros2 daemon is running. On CI machines, the the tests are flaky, but fail most of the time (eg. history on Focal)

Expected behavior

All tests pass.

Actual behavior

test_generate_policy_topics fails with

test/sros2/commands/security/verbs/test_generate_policy.py:44: in test_generate_policy_topics
    assert cli.main(
E   AssertionError: assert 1 == 0
E    +  where 1 = <function main at 0x7f2914956a60>(argv=['security', 'generate_policy', '/tmp/tmpaxpo04wh/test-policy.xml'])
E    +    where <function main at 0x7f2914956a60> = cli.main
----------------------------- Captured stderr call -----------------------------
No nodes detected in the ROS graph. No policy file was generated.

and test_generate_policy_services fails with

test/sros2/commands/security/verbs/test_generate_policy.py:96: in test_generate_policy_services
    assert cli.main(
E   AssertionError: assert 1 == 0
E    +  where 1 = <function main at 0x7f2914956a60>(argv=['security', 'generate_policy', '/tmp/tmp2k4qonwa/test-policy.xml'])
E    +    where <function main at 0x7f2914956a60> = cli.main
----------------------------- Captured stderr call -----------------------------
No nodes detected in the ROS graph. No policy file was generated.

Additional information

Adding a small sleep right before calling cli.main in both tests fixes the tests for me locally. Alternatively, passing --no-daemon to generate_policy fixes the issue as well, but I'm not sure which one, if either, is a good option.

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