swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: bd7c92ec7e637defd0065d7a836bfa4c386e4a74 authored by Shuhei Kadowaki on 27 February 2024, 08:52:43 UTC
1.11: allow external abstract interpreter compilation
Tip revision: bd7c92e
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