https://github.com/JuliaLang/julia
Revision 4ba81cb96264e4ae9202aad108bdbc86581a9d51 authored by Gabriel Baraldi on 26 October 2023, 15:04:29 UTC, committed by Gabriel Baraldi on 26 October 2023, 15:04:29 UTC
1 parent 30f542f
Raw File
Tip revision: 4ba81cb96264e4ae9202aad108bdbc86581a9d51 authored by Gabriel Baraldi on 26 October 2023, 15:04:29 UTC
Require patchelf to install llvm tools
Tip revision: 4ba81cb
stress_fd_exec.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test
let ps = Pipe[]
    ulimit_n = tryparse(Int, readchomp(`sh -c 'ulimit -n'`))
    try
        for i = 1:100*something(ulimit_n, 1000)
            p = Pipe()
            Base.link_pipe!(p)
            push!(ps, p)
        end
        if ulimit_n === nothing
            @warn "`ulimit -n` is set to unlimited, fd exhaustion cannot be tested"
            @test_broken false
        else
            @test false
        end
    catch ex
        isa(ex, Base.IOError) || rethrow()
        @test ex.code in (Base.UV_EMFILE, Base.UV_ENFILE)
    finally
        foreach(close, ps)
    end
end
back to top