about summary refs log tree commit homepage
path: root/test/fresh.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fresh.rb')
-rw-r--r--test/fresh.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/fresh.rb b/test/fresh.rb
index 4c53ac2..972f834 100644
--- a/test/fresh.rb
+++ b/test/fresh.rb
@@ -42,7 +42,7 @@ EOF
     50.times do
       break if File.size(@mogstored_pid.path) > 0
       sleep 0.1
-    end
+    end unless Integer === @mogstored_pid
   end
 
   def start_tracker
@@ -108,10 +108,12 @@ EOF
 
   def teardown_mogilefs
     return if $$ != @teardown_pid
-    if @mogstored_pid
+    if Integer === @mogstored_pid
+      pid = @mogstored_pid
+    else
       pid = File.read(@mogstored_pid.path).to_i
-      Process.kill(:TERM, pid) if pid > 0
     end
+    Process.kill(:TERM, pid) if pid > 0
     if @mogilefsd_pid
       s = TCPSocket.new(@test_host, @tracker_port)
       s.write "!shutdown\r\n"