Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests on Windows falsely positive reporting passed due to SIGINT handling #767

Open
huweiATgithub opened this issue Mar 13, 2024 · 1 comment
Labels
more-information-needed Further information is required

Comments

@huweiATgithub
Copy link

Bug report

Required Info:

  • Operating System: Windows
  • Installation type: Binary through Robostack/ms-iot
  • Version or commit hash: humble
  • DDS implementation: the default bundled one
  • Client library (if applicable): rclcpp

Steps to reproduce issue

  1. Write a launch file in Python to launch one or more nodes.
  2. Write a gtest executable (for communication) that exit with code 1.
  3. build and test with rostest and launch_testing.asserts.assertExitCodes:
     @pytest.mark.rostest
     def generate_test_description():
         return (
             LaunchDescription(
                 [...]
             ),
             {...: ...},
         )
     
     @launch_testing.post_shutdown_test()
     class TestOutcome(unittest.TestCase):
         def test_exit_codes(self, proc_info):
             launch_testing.asserts.assertExitCodes(proc_info)
    

Expected behavior

Failures are reported through assertExitCodes with a non-zero exit code.

Actual behavior

The test passes.

Additional information

This is related to #94 which sends SIGTERM (it is stated that SIGINT is not supported in Windows).
Besides, exit_code=1 is allowed in

# TODO(hidmic): Drop when SIGINT is fixed on Windows
EXIT_FORCED = 1
def assertExitCodes(proc_info,
allowable_exit_codes=[EXIT_OK] if os.name != 'nt' else [EXIT_OK, EXIT_FORCED],

Ask for help

  • Are there any available workarounds for writing tests on Windows?
  • Which component fails to handle SIGINT on Windows: the launch service or ROS2 executors?

@hidmic Do you have some information? (I notice the TODO are assigned to you.)

@huweiATgithub huweiATgithub changed the title Tests on Windows falsely positive reporting passed Tests on Windows falsely positive reporting passed due to SIGINT handling Mar 13, 2024
@fujitatomoya
Copy link

Write a gtest executable (for communication) that exit with code 1.
Are there any available workarounds for writing tests on Windows?

can you try exit code with different values like 2 or something else, to see if the test completes as expected?

@quarkytale quarkytale added the more-information-needed Further information is required label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

3 participants