From: daigo Date: Sat, 19 Jun 2010 08:19:59 +0000 (+0900) Subject: Improved stability of test results. X-Git-Tag: 20170902~119^2 X-Git-Url: http://git.sourceforge.jp/view?p=shogi-server%2Fshogi-server.git;a=commitdiff_plain;h=4a1ecd5e16dd90294c7793f6694284d7d3e5513e;hp=d42dec0ac3d93f262e441e7fc9fc9bacc71c5c52 Improved stability of test results. TestClientAtmark#test_toryomight sometimes fail. Adding a short sleep interval makes this issue happen less likely. 10 of 10 trials were successful. --- diff --git a/test/TC_functional.rb b/test/TC_functional.rb index 9b39a66..44b5240 100644 --- a/test/TC_functional.rb +++ b/test/TC_functional.rb @@ -25,7 +25,8 @@ class TestClientAtmark < BaseClient path = File.join( File.dirname(__FILE__), "..", year, month, day, "*atmark-1500-0*") log_files = Dir.glob(path) assert(!log_files.empty?) - log_content = File.open(log_files.sort.last).read + sleep 0.1 + log_content = File.read(log_files.sort.last) # "$EVENT", "$START_TIME" and "'$END_TIME" are removed since they vary dinamically. should_be = <<-EOF