Skip to content

Commit

Permalink
Disable even more FileWatching tests (#46497)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaraldi authored Aug 31, 2022
1 parent 7ab0c81 commit 682ae8a
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions stdlib/FileWatching/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ using Base: uv_error, Experimental
# Odd numbered pipes are tested for reads
# Even numbered pipes are tested for timeouts
# Writable ends are always tested for write-ability before a write
ismacos_arm = ((Sys.ARCH == :aarch64) && (Sys.isapple())) #https://github.com/JuliaLang/julia/issues/46185
ismacos_x86 = ((Sys.ARCH == :x86_64) && (Sys.isapple())) #Used to disable the unreliable macos tests

n = 20
intvls = [2, .2, .1, .005, .00001]

pipe_fds = fill((Base.INVALID_OS_HANDLE, Base.INVALID_OS_HANDLE), n)

for i in 1:n
if Sys.iswindows() || i > n ÷ 2
uv_error("socketpair", ccall(:uv_socketpair, Cint, (Cint, Cint, Ptr{NTuple{2, Base.OS_HANDLE}}, Cint, Cint), 1, (Sys.iswindows() ? 6 : 0), Ref(pipe_fds, i), 0, 0))
Expand All @@ -32,7 +34,9 @@ for i in 1:n
if !fd_in_limits && Sys.islinux()
run(`ls -la /proc/$(getpid())/fd`)
end
@test fd_in_limits
if !ismacos_arm
@test fd_in_limits
end
end

function pfd_tst_reads(idx, intvl)
Expand Down Expand Up @@ -183,16 +187,19 @@ function test_init_afile()
@test(watch_folder(dir) == (F_PATH => FileWatching.FileEvent(FileWatching.UV_RENAME)))
@test close(open(file, "w")) === nothing
sleep(3)
let c
c = watch_folder(dir, 0)
if F_GETPATH
@test c.first == F_PATH
@test c.second.changed c.second.renamed
@test !c.second.timedout
else # we don't expect to be able to detect file changes in this case
@test c.first == ""
@test !c.second.changed && !c.second.renamed
@test c.second.timedout
if !ismacos_x86
let c
c = watch_folder(dir, 0)

if F_GETPATH
@test c.first == F_PATH
@test c.second.changed c.second.renamed
@test !c.second.timedout
else # we don't expect to be able to detect file changes in this case
@test c.first == ""
@test !c.second.changed && !c.second.renamed
@test c.second.timedout
end
end
end
@test unwatch_folder(dir) === nothing
Expand Down Expand Up @@ -370,9 +377,9 @@ test_monitor_wait_poll()
test_watch_file_timeout(0.2)
test_watch_file_change(6)

if !((Sys.ARCH == :x86_64) && (Sys.isapple())) #These tests tend to fail a lot on x86-apple
test_dirmonitor_wait2(0.2) #because the os can reorder the events
test_dirmonitor_wait2(0.2) #see https://github.com/dotnet/runtime/issues/30415
if !ismacos_x86
test_dirmonitor_wait2(0.2)
test_dirmonitor_wait2(0.2)

mv(file, file * "~")
mv(file * "~", file)
Expand Down

0 comments on commit 682ae8a

Please sign in to comment.