Fixed race in tests.

This commit is contained in:
mbloch
2012-05-29 17:01:54 +01:00
parent 21ccd17ea5
commit cf2400fedd

View File

@@ -14,9 +14,11 @@ class FlexNBD
end end
def serve(ip, port, file, *acl) def serve(ip, port, file, *acl)
File.unlink(ctrl) if File.exists?(ctrl)
@pid = fork do @pid = fork do
exec("#{@bin} serve #{ip} #{port} #{file} #{ctrl} #{acl.join(' ')}") exec("#{@bin} serve #{ip} #{port} #{file} #{ctrl} #{acl.join(' ')}")
end end
sleep 0.1 until File.socket?(ctrl)
end end
def kill def kill