Repository navigation
Spec helper: require http/web_socket for the WebSocket client - #1481
Merged
Merged
Conversation
The websocket helpers open clients with HTTP::WebSocket.new(String). Since agent-crystal 1.22.3-incremental-1 (crimson-knight/crystal#45) that constructor lives in http/web_socket/client, which require "http" no longer loads, so the spec suite failed to compile at spec/support/helpers/websockets_helper.cr:39.
crystal spec keeps the compiler process and its heap alive while the spec binary runs. The fixture specs start a second compiler, and the two together went past the medium resource class's 4 GiB, so the kernel killed the outer compiler partway through the suite (builds 348, 349, 357). Building the suite in its own step lets that compiler exit before any spec runs.
Member
Author
|
Added 9a53f9c: CircleCI now builds the spec suite in one step and runs the binary in the next. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Amber's spec suite does not compile on agent-crystal 1.22.3-incremental-1 or later:
Since crimson-knight/crystal#45 (TLS opt-in, shipped in 1.22.3-incremental-1), the client constructor
HTTP::WebSocket.new(String)lives inhttp/web_socket/client, andrequire "http"no longer loads it. A server that only accepts WebSockets no longer pulls inHTTP::Clientand OpenSSL; a program that opens a WebSocket connection requireshttp/web_socket.Change
spec/spec_helper.craddsrequire "http/web_socket"afterrequire "http", with a comment naming the reason. Only the spec helper changes;require "http/web_socket"exists on public Crystal too, so the suite still compiles there.Spec run
m4-mini-02 (macOS 27.2.1, arm64), agent-crystal 1.22.3-incremental-1 (
Crystal 1.22.3 (2026-11-13)),TMPDIR=/tmp crystal-alpha spec, through cluster-pool:websockets_helper.cr:39(above).The failure and both errors are in
spec/amber/router/parsers/form_charset_spec.cr(lines 214, 142 and 207: the CP1252 converter spy and two "could not be decoded with its declared charset" cases). They concern form charset decoding, which the 1.22.3 fork does in Crystal (Mica) instead of iconv, and are unrelated to this change; :214 also failed in the crimson-knight/crystal#53 class check with both compilers.TMPDIR=/tmpkeeps the UNIX socket listener specs' paths under macOS's 103-byte limit (in a long scratch folder they error).