Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- 3.2
- 3.3
- 3.4
- "4.0"

fail-fast: false

Expand Down Expand Up @@ -94,6 +95,7 @@ jobs:
- 3.2
- 3.3
- 3.4
- "4.0"

fail-fast: false

Expand Down
1 change: 1 addition & 0 deletions ffi/lib/llhttp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module LLHttp
require_relative "llhttp/version"

extend FFI::Library

ffi_lib(FFI::Compiler::Loader.find("llhttp-ext"))

callback :llhttp_data_cb, [:pointer, :size_t], :void
Expand Down
19 changes: 16 additions & 3 deletions spec/acceptance/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,22 @@
@bound_endpoint&.close
end

it "parses" do
Timeout.timeout(1) do
expect(system("curl -v http://localhost:9000")).to be(true)
# The async-based test server requires Ruby >= 3.2: newer async drops 3.1, so
# on older Rubies bundle resolves to a stack that can't serve the request.
# llhttp core is still exercised by the rest of the suite on those versions.
it "parses", skip: RUBY_VERSION < "3.2" && "async test server requires Ruby >= 3.2" do
# Poll until the forked server is accepting and responding rather than
# asserting on a single curl under a tight timeout, so a slow fork + Async
# reactor cold start on a loaded CI runner costs a few retries, not a
# spurious failure.
result = false

Timeout.timeout(10) do
until (result = system("curl -sf http://localhost:9000", out: File::NULL, err: File::NULL))
sleep(0.05)
end
end

expect(result).to be(true)
end
end
2 changes: 1 addition & 1 deletion spec/initialize.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require "pathname"
require "pathname" # standard:disable Lint/RedundantRequireStatement -- needed on Ruby < 3.x where Pathname isn't autoloaded

initializers = Pathname.new(File.expand_path("../initializers", __FILE__))

Expand Down
Loading