Skip to content

Commit

Permalink
fix: fix heisenbug in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardacoppo committed Feb 18, 2025
1 parent 57b863c commit ab9d009
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions test/task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit ab9d009

Please sign in to comment.