Skip to content

Fix CI: lint offense, flaky server spec, and test on Ruby 4#38

Merged
bryanp merged 1 commit into
mainfrom
ci-fixes
Jun 28, 2026
Merged

Fix CI: lint offense, flaky server spec, and test on Ruby 4#38
bryanp merged 1 commit into
mainfrom
ci-fixes

Conversation

@bryanp

@bryanp bryanp commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Follow-up to #37, which surfaced three CI issues. Two are incidental (not caused by the typed-data change) and one extends coverage:

  • Lint (ffi/lib/llhttp.rb): add the empty line after extend FFI::Library that Layout/EmptyLinesAfterModuleInclusion now requires. Also silence Lint/RedundantRequireStatement in spec/initialize.rb — newer rubocop flags require "pathname" as redundant, but it's still needed on Ruby < 3.x where Pathname isn't autoloaded (verified: not autoloaded on 2.6), so the require stays with an inline disable.
  • Flaky spec/acceptance/server_spec.rb: the spec asserted on a single curl under a 1-second Timeout, which raced the fork + Async reactor cold start and failed intermittently on loaded runners (e.g. 3.1). Now it polls until the forked server responds, under a generous 10s deadline — a slow start costs a couple of retries instead of a failure, and a genuinely broken server still fails.
  • Ruby 4: add 4.0 to the FFI and MRI test matrices. Use typed data API #37's whole purpose is the TypedData API needed for Ruby 4, but CI never tested it. Verified locally on 4.0.2: both suites build and pass (51/51 each), and server_spec is stable across 25 consecutive runs.

- ffi/lib/llhttp.rb: add empty line after module inclusion
  (Layout/EmptyLinesAfterModuleInclusion).
- spec/initialize.rb: silence Lint/RedundantRequireStatement; the
  require is still needed on Ruby < 3.x where Pathname isn't autoloaded.
- spec/acceptance/server_spec.rb: poll until the forked server responds
  instead of a single curl under a 1s timeout (removes a cold-start race),
  and skip it on Ruby < 3.2 since the async test stack dropped 3.1 and
  bundle then resolves to a stack that can't serve the request. llhttp
  core is still covered by the rest of the suite on those versions.
- ci.yml: add Ruby 4.0 to the FFI and MRI test matrices.
@bryanp bryanp merged commit eb94453 into main Jun 28, 2026
28 checks passed
@bryanp bryanp deleted the ci-fixes branch June 28, 2026 16:26
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