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

K8s integration tests #2

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from
Draft

K8s integration tests #2

wants to merge 51 commits into from

Conversation

omus
Copy link
Member

@omus omus commented Mar 6, 2024

Adds integration tests to this package which utilize K8sDeputy.jl in a K8s cluster. Some of these tests verify the behaviour of Julia and K8s handling around graceful termination. If these tests fail this could indicate that the content in this package may need to be adjusted.

@omus
Copy link
Member Author

omus commented Mar 8, 2024

Interesting unit test failure. Probably just started this check before the server started? Probably just need to add a retry to this:

graceful termination: Error During Test at /home/runner/work/K8sDeputy.jl/K8sDeputy.jl/test/health.jl:217
  Test threw exception
  Expression: timedwait(Second(10)) do 
        #= /home/runner/work/K8sDeputy.jl/K8sDeputy.jl/test/health.jl:218 =#
        r = HTTP.get("http://$(localhost):$(port)/health/ready"; status_exception = false)
        #= /home/runner/work/K8sDeputy.jl/K8sDeputy.jl/test/health.jl:219 =#
        return r.status == 200
    end === :ok
  HTTP.ConnectError for url = `[http://127.0.0.1:53563/health/ready`:](http://127.0.0.1:53563/health/ready%60:) IOError: connect: connection refused (ECONNREFUSED)
  Stacktrace:
   [1] getconnection(::Type{Sockets.TCPSocket}, host::SubString{String}, port::SubString{String}; keepalive::Bool, readtimeout::Int64, kw::@Kwargs{require_ssl_verification::Bool, iofunction::Nothing, decompress::Nothing, verbose::Int64, status_exception::Bool})
     @ HTTP.Connections ~/.julia/packages/HTTP/LsfSO/src/Connections.jl:526
   [2] getconnection
     @ ~/.julia/packages/HTTP/LsfSO/src/Connections.jl:503 [inlined]
   [3] #10
     @ ~/.julia/packages/HTTP/LsfSO/src/Connections.jl:462 [inlined]
   [4] (::ConcurrentUtilities.var"#2#4"{Any, Timer, ConcurrentUtilities.TimedOut{Any}, Channel{Any}, HTTP.Connections.var"#10#13"{Sockets.TCPSocket, Bool, Bool, @Kwargs{readtimeout::Int64, iofunction::Nothing, decompress::Nothing, verbose::Int64, status_exception::Bool}, SubString{String}, SubString{String}}})()
     @ ConcurrentUtilities ~/.julia/packages/ConcurrentUtilities/yudGS/src/try_with_timeout.jl:82
  Stacktrace:
    [1] (::HTTP.ConnectionRequest.var"#connections#4"{HTTP.ConnectionRequest.var"#connections#1#5"{HTTP.TimeoutRequest.var"#timeouts#3"{HTTP.TimeoutRequest.var"#timeouts#1#4"{HTTP.ExceptionRequest.var"#exceptions#2"{HTTP.ExceptionRequest.var"#exceptions#1#3"{typeof(HTTP.StreamRequest.streamlayer)}}}}}})(req::HTTP.Messages.Request; proxy::Nothing, socket_type::Type, socket_type_tls::Type, readtimeout::Int64, connect_timeout::Int64, logerrors::Bool, logtag::Nothing, kw::@Kwargs{iofunction::Nothing, decompress::Nothing, verbose::Int64, status_exception::Bool})
      @ HTTP.ConnectionRequest ~/.julia/packages/HTTP/LsfSO/src/clientlayers/ConnectionRequest.jl:86
...
      @ HTTP ~/.julia/packages/HTTP/LsfSO/src/HTTP.jl:457
   [14] #request#20
      @ ~/.julia/packages/HTTP/LsfSO/src/HTTP.jl:315 [inlined]
   [15] request (repeats 2 times)
      @ ~/.julia/packages/HTTP/LsfSO/src/HTTP.jl:313 [inlined]
   [16] get
      @ ~/.julia/packages/HTTP/LsfSO/src/HTTP.jl:518 [inlined]
   [17] #36
      @ ~/work/K8sDeputy.jl/K8sDeputy.jl/test/health.jl:218 [inlined]
   [18] timedwait(testcb::var"#36#58"{Int64}, timeout::Float64; pollint::Float64)
      @ Base ./asyncevent.jl:341
   [19] #timedwait#2
      @ /opt/hostedtoolcache/julia/1.10.2/x64/share/julia/stdlib/v1.10/Dates/src/types.jl:470 [inlined]
   [20] timedwait(testcb::Function, timeout::Second)
      @ Dates /opt/hostedtoolcache/julia/1.10.2/x64/share/julia/stdlib/v1.10/Dates/src/types.jl:469
   [21] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.2/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:669 [inlined]
   [22] macro expansion
      @ ~/work/K8sDeputy.jl/K8sDeputy.jl/test/health.jl:217 [inlined]
   [23] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.2/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
   [24] macro expansion
      @ ~/work/K8sDeputy.jl/K8sDeputy.jl/test/health.jl:195 [inlined]
   [25] macro expansion
      @ /opt/hostedtoolcache/julia/1.10.2/x64/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
   [26] top-level scope
      @ ~/work/K8sDeputy.jl/K8sDeputy.jl/test/health.jl:13

@omus
Copy link
Member Author

omus commented Mar 8, 2024

Looked into the exact Julia version which started supporting Pkg.precompile(; timing) and found:

  • Pkg.jl PR to introduce the change was: precompile: add timing mode JuliaLang/Pkg.jl#3334
  • The stdlib/Pkg.version was updated to include this Pkg.jl version in Julia version 1.10.0-DEV.445 (1ef65e4c89) and "backported" in Julia version 1.9.0-beta2.67 (f5a6860559)

Base automatically changed from cv/initial to main March 8, 2024 20:27
@omus
Copy link
Member Author

omus commented Mar 11, 2024

I'm getting close to getting these integration tests working but I think I'll make the initial release of this package so I'm not holding things up.

@omus
Copy link
Member Author

omus commented May 1, 2024

I've had some other higher priority things to do lately but I do want to get back to this.

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

Successfully merging this pull request may close these issues.

1 participant