Skip to content

Commit

Permalink
test: Fix random test failures in test/plugin/test_out_forward.rb
Browse files Browse the repository at this point in the history
I notice that the following test cases (which are supposed to test the
handling of broken ack responses) are randomly failing on Travis CI:

 1. 'a destination node not supporting responses by disconnection'
 2. 'a destination node not supporting responses by just ignoring'

The root problem is that, since the destination node gets labelled as
"unavailable" after an ack failure, there really shouldn't be any flush
attempt after the testing steps (or it will raise a NoNodesAvailable
exception).

In most environments, this possibility does not pose much problems
because the test execution is sufficiently fast (so there is very
little space for an additional flush attempt to occur).

But since the CI server is known to become very slow from time to time,
we need to take special care for it.
  • Loading branch information
Fujimoto Seiji committed Mar 7, 2018
1 parent fa35835 commit 7f55d8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/plugin/test_out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ def read_ack_from_sock(sock, unpacker)
retry_type periodic
retry_wait 30s
flush_at_shutdown false # suppress errors in d.instance_shutdown
flush_thread_interval 30s
</buffer>
])

Expand All @@ -501,7 +502,7 @@ def read_ack_from_sock(sock, unpacker)
target_input_driver.end_if{ d.instance.rollback_count > 0 }
target_input_driver.end_if{ !node.available }
target_input_driver.run(expect_records: 2, timeout: 25) do
d.run(default_tag: 'test', timeout: 20, wait_flush_completion: false, shutdown: false) do
d.run(default_tag: 'test', timeout: 20, wait_flush_completion: false, shutdown: false, flush: false) do
delayed_commit_timeout_value = d.instance.delayed_commit_timeout
d.feed([[time, records[0]], [time,records[1]]])
end
Expand Down Expand Up @@ -530,6 +531,7 @@ def read_ack_from_sock(sock, unpacker)
retry_type periodic
retry_wait 30s
flush_at_shutdown false # suppress errors in d.instance_shutdown
flush_thread_interval 30s
</buffer>
])

Expand All @@ -545,7 +547,7 @@ def read_ack_from_sock(sock, unpacker)
target_input_driver.end_if{ d.instance.rollback_count > 0 }
target_input_driver.end_if{ !node.available }
target_input_driver.run(expect_records: 2, timeout: 25) do
d.run(default_tag: 'test', timeout: 20, wait_flush_completion: false, shutdown: false) do
d.run(default_tag: 'test', timeout: 20, wait_flush_completion: false, shutdown: false, flush: false) do
delayed_commit_timeout_value = d.instance.delayed_commit_timeout
d.feed([[time, records[0]], [time,records[1]]])
end
Expand Down

0 comments on commit 7f55d8d

Please sign in to comment.