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

Use random port during testing #349

Closed
maleadt opened this issue Sep 26, 2022 · 1 comment
Closed

Use random port during testing #349

maleadt opened this issue Sep 26, 2022 · 1 comment

Comments

@maleadt
Copy link

maleadt commented Sep 26, 2022

Currently the async.jl test is hard-coded to use port 7777, which can lead to test failures when doing multiple tests of JSON at the same time (e.g. on PkgEval):

async: Error During Test at /usr/local/share/julia/packages/JSON/NeJ9k/test/runtests.jl:69
  Got exception outside of a @test
  LoadError: IOError: listen: address already in use (EADDRINUSE)
  Stacktrace:
    [1] uv_error
      @ ./libuv.jl:97 [inlined]
    [2] #listen#13
      @ /opt/julia/share/julia/stdlib/v1.8/Sockets/src/Sockets.jl:629 [inlined]
    [3] #listen#10
      @ /opt/julia/share/julia/stdlib/v1.8/Sockets/src/Sockets.jl:622 [inlined]
    [4] #listen#12
      @ /opt/julia/share/julia/stdlib/v1.8/Sockets/src/Sockets.jl:626 [inlined]
    [5] #listen#11
      @ /opt/julia/share/julia/stdlib/v1.8/Sockets/src/Sockets.jl:625 [inlined]
    [6] listen(port::Int64)
      @ Sockets /opt/julia/share/julia/stdlib/v1.8/Sockets/src/Sockets.jl:625
    [7] top-level scope
      @ /usr/local/share/julia/packages/JSON/NeJ9k/test/async.jl:11
    [8] include(fname::String)
      @ Base.MainInclude ./client.jl:476
    [9] macro expansion
      @ /usr/local/share/julia/packages/JSON/NeJ9k/test/runtests.jl:70 [inlined]
   [10] macro expansion
      @ /opt/julia/share/julia/stdlib/v1.8/Test/src/Test.jl:1357 [inlined]
   [11] macro expansion
      @ /usr/local/share/julia/packages/JSON/NeJ9k/test/runtests.jl:70 [inlined]
   [12] macro expansion
      @ /opt/julia/share/julia/stdlib/v1.8/Test/src/Test.jl:1357 [inlined]
   [13] top-level scope
      @ /usr/local/share/julia/packages/JSON/NeJ9k/test/runtests.jl:64
   [14] include(fname::String)
      @ Base.MainInclude ./client.jl:476
   [15] top-level scope
      @ none:6
   [16] eval
      @ ./boot.jl:368 [inlined]
   [17] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:276
   [18] _start()
      @ Base ./client.jl:522
  in expression starting at /usr/local/share/julia/packages/JSON/NeJ9k/test/async.jl:11
quinnj added a commit that referenced this issue Sep 26, 2022
@quinnj
Copy link
Member

quinnj commented Sep 26, 2022

PR up: #350

@quinnj quinnj closed this as completed in 60836ac Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants