From c0ec5902d4d64923c2e7dfca83436d12e4fbf1c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Wed, 17 Jun 2020 21:37:43 +0200 Subject: [PATCH 1/2] WebSocket HTTPS spec: close websocket from server side It looks like shutting down the server with the client socket already closed, fails at writing some TLS session shutdown messages. The spec would fail on some OpenSSL versions or environments with: Failed to raise an exception: 556175744 [0xaaaae58ecf54] *Exception::CallStack::print_backtrace:Int32 +100 [0xaaaae58bd004] __crystal_raise +80 [0xaaaae5a24cb4] *Socket+ +208 [0xaaaae5a24904] *Socket+ +196 [0xaaaae58cfbe8] ~procProc(Pointer(LibCrypto::Bio), Pointer(UInt8), UInt64, Pointer(UInt64), Int32) +932 [0xffffb3ac986c] ??? Tried to raise:: Error writing to socket: Broken pipe (IO::Error) from src/io/evented.cr:82:13 in 'unbuffered_write' from src/io/buffered.cr:136:14 in 'write' from src/openssl/bio.cr:31:7 in '->' from ??? fixup! WebSocket HTTPS spec: Wait before shutting down the server --- spec/std/http/web_socket_spec.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/std/http/web_socket_spec.cr b/spec/std/http/web_socket_spec.cr index ad3b35c2e167..a0d9cf0d0e04 100644 --- a/spec/std/http/web_socket_spec.cr +++ b/spec/std/http/web_socket_spec.cr @@ -393,6 +393,7 @@ describe HTTP::WebSocket do ws.on_message do |str| ws.send("pong #{str}") + ws.close end ws.on_close do @@ -415,7 +416,6 @@ describe HTTP::WebSocket do random = Random::Secure.hex ws2.on_message do |str| str.should eq("pong #{random}") - ws2.close end ws2.send(random) From 6c2400140781d8ba88598001bb5d77d3a351ef83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Thu, 2 Jul 2020 18:03:13 +0200 Subject: [PATCH 2/2] Add Github actions workflow for testing on Alpine aarch64 --- .github/workflows/aarch64.yml | 101 ++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 .github/workflows/aarch64.yml diff --git a/.github/workflows/aarch64.yml b/.github/workflows/aarch64.yml new file mode 100644 index 000000000000..8d5d13d6220b --- /dev/null +++ b/.github/workflows/aarch64.yml @@ -0,0 +1,101 @@ +name: AArch64 CI + +on: [push, pull_request] + +jobs: + musl-build: + runs-on: [linux, ARM64] + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Build Crystal + uses: docker://jhass/crystal:0.35.0-alpine-build + with: + args: make crystal + - name: Upload Crystal executable + uses: actions/upload-artifact@v1 + with: + name: crystal-aarch64-musl + path: .build/crystal + musl-test-stdlib: + needs: musl-build + runs-on: [linux, ARM64] + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Download Crystal executable + uses: actions/download-artifact@v1 + with: + name: crystal-aarch64-musl + path: .build/ + - name: Mark downloaded compiler as executable + run: chmod +x .build/crystal + - name: Run stdlib specs + uses: docker://jhass/crystal:0.35.0-alpine-build + with: + args: make std_spec + musl-test-compiler: + needs: musl-build + runs-on: [linux, ARM64] + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Download Crystal executable + uses: actions/download-artifact@v1 + with: + name: crystal-aarch64-musl + path: .build/ + - name: Mark downloaded compiler as executable + run: chmod +x .build/crystal + - name: Run compiler specs + uses: docker://jhass/crystal:0.35.0-alpine-build + with: + args: make compiler_spec + gnu-build: + runs-on: [linux, ARM64] + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Build Crystal + uses: docker://jhass/crystal:0.35.0-build + with: + args: make crystal + - name: Upload Crystal executable + uses: actions/upload-artifact@v1 + with: + name: crystal-aarch64-gnu + path: .build/crystal + gnu-test-stdlib: + needs: gnu-build + runs-on: [linux, ARM64] + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Download Crystal executable + uses: actions/download-artifact@v1 + with: + name: crystal-aarch64-gnu + path: .build/ + - name: Mark downloaded compiler as executable + run: chmod +x .build/crystal + - name: Run stdlib specs + uses: docker://jhass/crystal:0.35.0-build + with: + args: make std_spec + gnu-test-compiler: + needs: gnu-build + runs-on: [linux, ARM64] + steps: + - name: Download Crystal source + uses: actions/checkout@v2 + - name: Download Crystal executable + uses: actions/download-artifact@v1 + with: + name: crystal-aarch64-gnu + path: .build/ + - name: Mark downloaded compiler as executable + run: chmod +x .build/crystal + - name: Run compiler specs + uses: docker://jhass/crystal:0.35.0-build + with: + args: make compiler_spec