-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cli option compression-threads-priority (#1768)
* Add cli option compression-threads-priority Signed-off-by: Roman Sokolkov <[email protected]> * Fix CI issues Signed-off-by: Roman Sokolkov <[email protected]> * Add timeout for the test_priority_propagated_into_compression_thread Signed-off-by: Michael Orlov <[email protected]> * Update help section and doxygen comments for thread priority parameters Signed-off-by: Michael Orlov <[email protected]> * Use integer type for compression threads priority default value in tests - Rationale: To test the same behavior as in the writer factory class Signed-off-by: Michael Orlov <[email protected]> --------- Signed-off-by: Roman Sokolkov <[email protected]> Signed-off-by: Michael Orlov <[email protected]> Co-authored-by: Michael Orlov <[email protected]> (cherry picked from commit 25c3e1c)
- Loading branch information
1 parent
ea10111
commit 72ea3bb
Showing
8 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
ros2bag/test/test_record_with_compression_thread_priority.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2024 Open Source Robotics Foundation, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from pathlib import Path | ||
import tempfile | ||
|
||
import unittest | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import ExecuteProcess | ||
|
||
import launch_testing | ||
import launch_testing.actions | ||
|
||
import pytest | ||
|
||
|
||
@pytest.mark.launch_test | ||
def generate_test_description(): | ||
tmp_dir_name = tempfile.mkdtemp() | ||
output_path = Path(tmp_dir_name) / 'ros2bag_test_record_with_compression_thread_priority' | ||
record_process = ExecuteProcess( | ||
cmd=['ros2', 'bag', 'record', '-a', '--output', output_path.as_posix(), | ||
'--log-level', 'debug', '--compression-threads-priority', '1', | ||
'--compression-mode', 'file', '--compression-format', 'zstd'], | ||
name='ros2bag-cli', | ||
output='screen', | ||
) | ||
|
||
return LaunchDescription([ | ||
record_process, | ||
launch_testing.actions.ReadyToTest() | ||
]), locals() | ||
|
||
|
||
class TestRecordWithCompressionThreadPriority(unittest.TestCase): | ||
|
||
def test_priority_propagated_into_compression_thread( | ||
self, record_process, proc_output): | ||
proc_output.assertWaitFor( | ||
'Setting compression thread priority to 1', | ||
timeout=45, | ||
process=record_process | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters