Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Fixed relative path include on remote machines #21832

Merged
merged 9 commits into from
Jun 27, 2017
35 changes: 35 additions & 0 deletions test/distributed_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1569,6 +1569,41 @@ catch ex
@test ex.captured.ex.exceptions[2].ex == UndefVarError(:DontExistOn1)
end

@test let
# creates a new worker in the same folder and tries to include file on both procs
try
touch("temp.jl")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should avoid assuming the current working directory is writable, in some installations it won't be - a mktemp() do block might work well here

proc = addprocs_with_testenv(1)
include("temp.jl")
remotecall_fetch(include, proc[1], "temp.jl")
rmprocs(proc)
rm("temp.jl")
return true
catch e
try rm("temp.jl") end
return false
end
end == true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test that passes on both versions.


@test let
# creates a new worker in the different folder and tries to include file on both procs
try
mkdir("temp_folder")
touch("temp.jl")
proc = addprocs_with_testenv(1, dir="temp_folder")
include("temp.jl")
remotecall_fetch(include, proc[1], "temp.jl")
rmprocs(proc)
rm("temp_folder")
rm("temp.jl")
return true
catch e
try rm("temp_folder") end
try rm("temp.jl") end
return false
end
end == true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test that requires the fix to pass.


# Run topology tests last after removing all workers, since a given
# cluster at any time only supports a single topology.
rmprocs(workers())
Expand Down