From 29d2f7e45bbb67d97f3674b773e9ae0c1cfbbb41 Mon Sep 17 00:00:00 2001 From: Fujimoto Seiji Date: Wed, 7 Mar 2018 14:19:49 +0900 Subject: [PATCH] test: Fix random test failures in test/plugin/test_out_forward.rb 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. --- test/plugin/test_out_forward.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/plugin/test_out_forward.rb b/test/plugin/test_out_forward.rb index 722e1bacff..193355baad 100644 --- a/test/plugin/test_out_forward.rb +++ b/test/plugin/test_out_forward.rb @@ -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 ]) @@ -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 @@ -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 ]) @@ -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