test(MultiThreadedAgnocastExecutor): verify that starvation does not occur #435
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
MultiThreadedAgnocastExecutorにてスタベーションが発生しないことを検証するテストを追加しました。基本はSingleThreadedAgnocastExecutorへのテストと同じです。
MultiThreadedAgnocastExecutorの場合はcallback groupもスタベーションに関わってきますが、本テストでは全てのcallbackを別々のcallback groupに所属させたケースにスコープを絞っています。callback groupを設定した時のスタベーションの検証は別のテストで行います。
Related links
How was this PR tested?
bash scripts/test_and_create_report
Notes for reviewers
このテストには以下10個のパラメータがあります。
PUB_PERIOD
)ros2_spin()
を実行するスレッド数 (NUMBER_OF_ROS2_THREADS
)agnocast_spin()
を実行するスレッド数 (NUMBER_OF_AGNOCAST_THREADS
)NUM_ROS2_SUB_CBS
)NUM_AGNOCAST_SUB_CBS
)spin()
後にregisterされるAgnocast subscription callbackの数 (NUM_AGNOCAST_CBS_TO_BE_ADDED
)yield_before_execute
ros2_next_exec_timeout
agnocast_next_exec_timeout_ms
spin_duration
)※
AGNOCAST_CALLBACK_GROUP_WAIT_TIME
はこのテストでは意味を持たないので、デフォルト値にしています。このうち、1--3は決め打ちの固定値を使用し、4--6はそれらの値を使用して以下のように設定しています。
7--9は色々変動させるべきだと思ったので、パラメータ化しました。8,9を別々のパラメータにすると組み合わせ数が増えすぎるかなという判断で、1つのパラメータに統合しています(同じ値に設定する)。
そして、10は以下のようにざっくり理論値計算して、それを使用しています。