diff --git a/test/task_test.rb b/test/task_test.rb index 530b7e9..e76e80f 100644 --- a/test/task_test.rb +++ b/test/task_test.rb @@ -212,9 +212,13 @@ command = { states: [{ data: 0 }] } expect_execution do syskit_write controller.w_commands_port, command + end.to do # rubocop:disable Style/MultilineBlockChain + have_one_new_sample(state.r_states_port) + end + expect_execution do break_and_reestablish_connection(init: false) end.to do # rubocop:disable Style/MultilineBlockChain - have_no_new_sample(state.r_states_port) + have_no_new_sample(state.r_states_port, at_least_during: 1) end end @@ -223,8 +227,12 @@ configure_and_start_tasks connect_tasks command = { states: [{ data: 0 }] } - sample = expect_execution do + expect_execution do syskit_write controller.w_commands_port, command + end.to do # rubocop:disable Style/MultilineBlockChain + have_one_new_sample(state.r_states_port) + end + sample = expect_execution do break_and_reestablish_connection end.to do # rubocop:disable Style/MultilineBlockChain have_one_new_sample(state.r_states_port) @@ -238,8 +246,12 @@ configure_and_start_tasks connect_tasks command = { states: [{ data: 0 }] } - sample = expect_execution do + expect_execution do syskit_write controller.w_commands_port, command + end.to do # rubocop:disable Style/MultilineBlockChain + have_one_new_sample(state.r_states_port) + end + sample = expect_execution do break_and_reestablish_connection(delay: 1) end.to do # rubocop:disable Style/MultilineBlockChain have_one_new_sample(state.r_states_port) @@ -254,6 +266,10 @@ command = { states: [{ data: 0 }] } sample = expect_execution do syskit_write controller.w_commands_port, command + end.to do # rubocop:disable Style/MultilineBlockChain + have_one_new_sample(state.r_states_port) + end + sample = expect_execution do 3.times do break_and_reestablish_connection end