From ab87a8472ee42785364ab1ee84ea00e06cb592d8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 24 Dec 2008 03:22:57 -0800 Subject: [PATCH] test_mogilefs: fix broken test case that was timing out And incorrectly nested assertions in the tests made sure the errors were never caught, too. Now the unit tests run in about 3s for me Damn Ruby conventions and 2-space indents... --- test/test_mogilefs.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test_mogilefs.rb b/test/test_mogilefs.rb index e8e96c6..93de323 100644 --- a/test/test_mogilefs.rb +++ b/test/test_mogilefs.rb @@ -64,7 +64,7 @@ class TestMogileFS__MogileFS < TestMogileFS readed = client.recv(4096, 0) assert(readed =~ \ %r{\AGET /dev[12]/0/000/000/0000000062\.fid HTTP/1.[01]\r\n\r\n\Z}) - syswrloop(tmpfp, client) + sysrwloop(tmpfp, client) client.close end t1 = TempServer.new(svr) @@ -75,9 +75,9 @@ class TestMogileFS__MogileFS < TestMogileFS @backend.get_paths = { 'paths' => 2, 'path1' => path1, 'path2' => path2 } data = Tempfile.new('test_mogilefs.dest_data') + read_nr = nr = 0 @client.get_file_data('key') do |fp| buf = '' - read_nr = nr = 0 loop do begin fp.sysread(16384, buf) @@ -88,9 +88,9 @@ class TestMogileFS__MogileFS < TestMogileFS break end end - assert_equal expect_size, nr, "size mismatch" - assert_equal 1, accept_nr end + assert_equal expect_size, nr, "size mismatch" + assert_equal 1, accept_nr end def test_get_paths -- 2.11.4.GIT