-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Description
The following test case is from #470:
@testset "issue 466" begin
file_name = "hang.txt"
try
S3.put_object("anewbucket", file_name)
# Note: Using `eof` for these tests can hang when using an unclosed `Base.BufferStream`
stream = S3.get_object("anewbucket", file_name, Dict("return_stream" => true))
if AWS.DEFAULT_BACKEND[] isa AWS.HTTPBackend
@test !isopen(stream)
else
@test isopen(stream)
end
stream = Base.BufferStream()
S3.get_object("anewbucket", file_name, Dict("response_stream" => stream))
if AWS.DEFAULT_BACKEND[] isa AWS.HTTPBackend
@test !isopen(stream)
else
@test_broken isopen(stream)
end
stream = Base.BufferStream()
S3.get_object(
"anewbucket",
file_name,
Dict("response_stream" => stream, "return_stream" => true),
)
if AWS.DEFAULT_BACKEND[] isa AWS.HTTPBackend
@test !isopen(stream)
else
@test isopen(stream)
end
finally
S3.delete_object("anewbucket", file_name)
end
endNote how when using a non-IOBuffer and not using the "return_stream" parameter that the I/O stream is closed but in all other cases it leaves the stream open. This inconsistency should not be present.
Additionally, most likely the behaviour of the HTTPBackend and the DownloadsBackend should made to be consistent.
Metadata
Metadata
Assignees
Labels
No labels