diff --git a/rcl/test/rcl/test_get_actual_qos.cpp b/rcl/test/rcl/test_get_actual_qos.cpp index c8570f4af..54616ebcc 100644 --- a/rcl/test/rcl/test_get_actual_qos.cpp +++ b/rcl/test/rcl/test_get_actual_qos.cpp @@ -133,9 +133,9 @@ TEST_P_RMW(TestGetActualQoS, test_publisher_get_qos_settings) { EXPECT_EQ( qos->history, parameters.qos_expected.history); - EXPECT_EQ( - qos->depth, - parameters.qos_expected.depth); + if (parameters.qos_expected.history == RMW_QOS_POLICY_HISTORY_KEEP_LAST) { + EXPECT_EQ(qos->depth, parameters.qos_expected.depth); + } EXPECT_EQ( qos->reliability, parameters.qos_expected.reliability);