Add test to check when proxy times-out mid-write to upstream
I've add to add code to allow the environment to specify the upstream tiemout so we don't have to wait 30s for this test to happen.
This commit is contained in:
@@ -54,6 +54,10 @@ module FlexNBD
|
||||
write_reply(handle, 1)
|
||||
end
|
||||
|
||||
def nread
|
||||
@sock.nread
|
||||
end
|
||||
|
||||
def disconnected?
|
||||
Timeout.timeout(2) do
|
||||
@sock.read(1).nil?
|
||||
@@ -85,6 +89,10 @@ module FlexNBD
|
||||
@sock.write(len)
|
||||
end
|
||||
|
||||
def getsockopt(level, optname)
|
||||
@sock.getsockopt(level, optname)
|
||||
end
|
||||
|
||||
def self.parse_be64(str)
|
||||
raise "String is the wrong length: 8 bytes expected (#{str.length} received)" unless
|
||||
str.length == 8
|
||||
|
Reference in New Issue
Block a user