Fix eof() and read*() behaviour for ::File and ::LibuvStream#14699
Fix eof() and read*() behaviour for ::File and ::LibuvStream#14699vtjnash merged 7 commits intoJuliaLang:masterfrom
Conversation
8f0ef7f to
09ae7ee
Compare
1061c85 to
f7da086
Compare
|
It looks like this new test is failing on Win32 Maybe a DOS line-ending issue? Could someone who has windows please look at this? edit: I think this is resolved now, the last appveyor build ran fine except for a crash deleting a tmp directory due to open files, running again now with a fix for that... |
f7da086 to
69f1587
Compare
|
Please separate the introduction of new methods from bug fixes into separate PRs. |
|
Appveyor now says |
e90ec35 to
680573e
Compare
Adding the missing methods is the bug fix. Handling |
Then what was the purpose of opening the PR with a single commit, then adding additional content to it? The new test in the first commit didn't seem to need these new methods to pass, so why are these in the same PR? |
1703c9d to
cf6fdc1
Compare
|
@vtjnash, does this fix look right to you? |
test/read.jl
Outdated
There was a problem hiding this comment.
Nice one. I've just rebased.
cf6fdc1 to
0032cd6
Compare
6ca31cd to
acde35e
Compare
|
Windows now passing CI. |
test/read.jl
Outdated
There was a problem hiding this comment.
If this can't run on travis, chances are it can't run on distro buildbots either. Not a good idea to special-case for CI like this.
There was a problem hiding this comment.
Most definitely agree!
Just attempting to discover which part of the code is causing deadlock...
There was a problem hiding this comment.
ahk. did you track it down? I'm finding TCPSockets kind of challenging to add tests for myself. This branch helps get MbedTLS working again, though I'm not sure what its impacts are on the optimizations Jameson had been working towards.
There was a problem hiding this comment.
I hope that this yield() will fix the deadlock. Waiting for Travis to start up to find out...
cf44c8f to
490cee3
Compare
|
the commit |
edbefe8 to
0cbf1c7
Compare
|
remaining untested methods from #14608:
not-directly-tested newly introduced methods:
|
0cbf1c7 to
d1820c4
Compare
test/read.jl
Outdated
There was a problem hiding this comment.
the strange spacing is really distracting here
There was a problem hiding this comment.
I've just taken out most of the temporary cleanup() calls.
That was an attempt to figure out why CI was hanging (i.e. maybe because of too many tasks/file handles/sockets ...).
You're talking about these right? readavailable(io::File) = read(io)
readavailable(io::AbstractIOBuffer) = read(io)
readavailable(s::IOStream) = read!(s, Vector{UInt8}(nb_available(s)))... called from here: function write(to::IO, from::IO)
while !eof(from)
write(to, readavailable(from))
end
end...which is tested with 15 combinations of What, in your opinion, would be an adequate test??? |
|
That's fine. An indirect test is better than no test, but that's literally the only call site of |
|
All the CI is passing now. (with #14747 test disabled). Passing tests cover something like: |
I think I understand your concern. I think that I also think that this generic implementation of |
|
It is pretty widely used in packages according to github code search, which is most of my concern about it not being directly unit-tested here. So un-exporting it or deprecating it would break code / introduce warnings outside of base but not the tests within base (still probably worth the cleanup to do at some point though). "untested" was imprecise and unfair wording, sorry. |
ff9fc62 to
b815e0a
Compare
Add eof(::File), seek(::File) etc
to be consisitent with other ::IOs See test case
JuliaLang#14747 clean up (hopefully) redundant celanup() calls in test/read.jl (left over from debugging hanging CI)
b815e0a to
98744de
Compare
|
ready to merge? |
that's annoying. i just read through the 12 pages of search results and found the following use cases for
|
Fix eof() and read*() behaviour for ::File and ::LibuvStream
|
Changes Unknown when pulling 98744de on samoconnor:uv_fs_read_eof into ** on JuliaLang:master**. |
See new test at end of test/file.jl
See new test/read.jl