Skip to content

Commit

Permalink
Add patch and test job for starvation on bigger SSL records
Browse files Browse the repository at this point in the history
  • Loading branch information
larskanis committed Nov 29, 2024
1 parent c6d1047 commit 44e2cb8
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 259 deletions.
237 changes: 130 additions & 107 deletions .github/workflows/binary-gems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
fail-fast: false
matrix:
include:
- platform: "x64-mingw-ucrt"
- platform: "x64-mingw32"
- platform: "x86-mingw32"
# - platform: "x64-mingw-ucrt"
# - platform: "x64-mingw32"
# - platform: "x86-mingw32"
- platform: "x86_64-linux"
steps:
- uses: actions/checkout@v4
Expand All @@ -43,112 +43,134 @@ jobs:
name: binary-gem-${{ matrix.platform }}
path: pkg/*.gem

job_test_binary:
name: Test
# job_test_binary:
# name: Test
# needs: rcd_build
# strategy:
# fail-fast: false
# matrix:
# include:
# - os: windows-latest
# ruby: "3.3"
# platform: "x64-mingw-ucrt"
# - os: windows-latest
# ruby: "3.1.4-1"
# platform: "x86-mingw32"
# PGVERSION: 10.20-1-windows
# - os: windows-latest
# ruby: "2.7"
# platform: "x64-mingw32"
# PGVERSION: 16.6-1-windows-x64
# - os: ubuntu-latest
# ruby: "3.2"
# platform: "x86_64-linux"
#
# runs-on: ${{ matrix.os }}
# env:
# PGVERSION: ${{ matrix.PGVERSION }}
# steps:
# - uses: actions/checkout@v4
# - name: Set up Ruby
# if: matrix.platform != 'x86-mingw32'
# uses: ruby/setup-ruby-pkgs@v1
# with:
# ruby-version: ${{ matrix.ruby }}
# apt-get: "postgresql" # Ubuntu
# brew: "postgresql" # macOS
# mingw: "postgresql" # Windows mingw / mswin /ucrt
#
# - name: Set up 32 bit x86 Ruby
# if: matrix.platform == 'x86-mingw32'
# run: |
# $(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-${{ matrix.ruby }}/rubyinstaller-${{ matrix.ruby }}-x86.exe", "$pwd/ruby-setup.exe")
# cmd /c ruby-setup.exe /currentuser /verysilent /dir=C:/Ruby-${{ matrix.ruby }}
# echo "c:/ruby-${{ matrix.ruby }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
#
# c:/ruby-${{ matrix.ruby }}/bin/ridk enable
# c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed make `${MINGW_PACKAGE_PREFIX}-pkgconf `${MINGW_PACKAGE_PREFIX}-libyaml `${MINGW_PACKAGE_PREFIX}-gcc `${MINGW_PACKAGE_PREFIX}-make"
# echo "C:/msys64/$env:MSYSTEM_PREFIX/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
#
# - name: Download gem from build job
# uses: actions/download-artifact@v4
# with:
# name: binary-gem-${{ matrix.platform }}
#
# - name: Download PostgreSQL 32-bit
# if: ${{ matrix.os == 'windows-latest' && matrix.PGVERSION }}
# run: |
# Add-Type -AssemblyName System.IO.Compression.FileSystem
# function Unzip {
# param([string]$zipfile, [string]$outpath)
# [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
# }
# $(new-object net.webclient).DownloadFile("http://get.enterprisedb.com/postgresql/postgresql-$env:PGVERSION-binaries.zip", "postgresql-binaries.zip")
# Unzip "postgresql-binaries.zip" "."
# echo "$pwd/pgsql/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
#
# - name: set PGUSER
# if: ${{ matrix.os == 'windows-latest' }}
# run: |
# echo "PGUSER=$env:USERNAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# echo "PGPASSWORD=" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
#
# - run: echo $env:PATH
# - run: gem update --system 3.3.26
# - run: bundle install
# - run: gem install --local pg-*${{ matrix.platform }}.gem --verbose
# - name: Run specs
# if: ${{ matrix.os != 'windows-latest' }}
# run: ruby -rpg -S rspec -fd spec/**/*_spec.rb
# - name: Run specs
# if: ${{ matrix.os == 'windows-latest' }}
# run: |
# ridk enable
# ruby -rpg -S rspec -fd spec/**/*_spec.rb
#
# - name: Print logs if job failed
# if: ${{ failure() && matrix.os == 'windows-latest' }}
# run: |
# ridk enable
# find "$(ruby -e"puts RbConfig::CONFIG[%q[libdir]]")" -name mkmf.log -print0 | xargs -0 cat
# find -name setup.log -print0 | xargs -0 cat
#
#
# job_binary_multiarch:
# name: multiarch (${{matrix.platform}} on ${{matrix.from_image}} ${{matrix.image_platform}})
# needs: rcd_build
# strategy:
# fail-fast: false
# matrix:
# include:
# - from_image: fedora:39
# image_platform: linux/x86_64
# gem_platform: x86_64-linux
# dockerfile: centos
# - from_image: alpine
# image_platform: linux/x86_64
# gem_platform: x86_64-linux
# dockerfile: alpine
#
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Download gem-${{ matrix.gem_platform }}
# uses: actions/download-artifact@v4
# with:
# name: binary-gem-${{ matrix.gem_platform }}
# - name: Build image and Run tests
# run: |
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# docker build --rm --platform ${{matrix.image_platform}} --build-arg from_image=${{matrix.from_image}} -t ruby-test -f spec/env/Dockerfile.${{matrix.dockerfile}} .
# docker run --rm -t --network=host -v `pwd`:/build ruby-test

job_binary_yugabyte:
name: yugabyte (${{matrix.gem_platform}}
needs: rcd_build
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
ruby: "3.3"
platform: "x64-mingw-ucrt"
- os: windows-latest
ruby: "3.1.4-1"
platform: "x86-mingw32"
PGVERSION: 10.20-1-windows
- os: windows-latest
ruby: "2.7"
platform: "x64-mingw32"
PGVERSION: 16.6-1-windows-x64
- os: ubuntu-latest
ruby: "3.2"
platform: "x86_64-linux"

runs-on: ${{ matrix.os }}
env:
PGVERSION: ${{ matrix.PGVERSION }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
if: matrix.platform != 'x86-mingw32'
uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: "postgresql" # Ubuntu
brew: "postgresql" # macOS
mingw: "postgresql" # Windows mingw / mswin /ucrt

- name: Set up 32 bit x86 Ruby
if: matrix.platform == 'x86-mingw32'
run: |
$(new-object net.webclient).DownloadFile("https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-${{ matrix.ruby }}/rubyinstaller-${{ matrix.ruby }}-x86.exe", "$pwd/ruby-setup.exe")
cmd /c ruby-setup.exe /currentuser /verysilent /dir=C:/Ruby-${{ matrix.ruby }}
echo "c:/ruby-${{ matrix.ruby }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
c:/ruby-${{ matrix.ruby }}/bin/ridk enable
c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed make `${MINGW_PACKAGE_PREFIX}-pkgconf `${MINGW_PACKAGE_PREFIX}-libyaml `${MINGW_PACKAGE_PREFIX}-gcc `${MINGW_PACKAGE_PREFIX}-make"
echo "C:/msys64/$env:MSYSTEM_PREFIX/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Download gem from build job
uses: actions/download-artifact@v4
with:
name: binary-gem-${{ matrix.platform }}

- name: Download PostgreSQL 32-bit
if: ${{ matrix.os == 'windows-latest' && matrix.PGVERSION }}
run: |
Add-Type -AssemblyName System.IO.Compression.FileSystem
function Unzip {
param([string]$zipfile, [string]$outpath)
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
}
$(new-object net.webclient).DownloadFile("http://get.enterprisedb.com/postgresql/postgresql-$env:PGVERSION-binaries.zip", "postgresql-binaries.zip")
Unzip "postgresql-binaries.zip" "."
echo "$pwd/pgsql/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: set PGUSER
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo "PGUSER=$env:USERNAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PGPASSWORD=" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- run: echo $env:PATH
- run: gem update --system 3.3.26
- run: bundle install
- run: gem install --local pg-*${{ matrix.platform }}.gem --verbose
- name: Run specs
if: ${{ matrix.os != 'windows-latest' }}
run: ruby -rpg -S rspec -fd spec/**/*_spec.rb
- name: Run specs
if: ${{ matrix.os == 'windows-latest' }}
run: |
ridk enable
ruby -rpg -S rspec -fd spec/**/*_spec.rb
- name: Print logs if job failed
if: ${{ failure() && matrix.os == 'windows-latest' }}
run: |
ridk enable
find "$(ruby -e"puts RbConfig::CONFIG[%q[libdir]]")" -name mkmf.log -print0 | xargs -0 cat
find -name setup.log -print0 | xargs -0 cat
job_binary_multiarch:
name: multiarch (${{matrix.platform}} on ${{matrix.from_image}} ${{matrix.image_platform}})
needs: rcd_build
strategy:
fail-fast: false
matrix:
include:
- from_image: fedora:39
image_platform: linux/x86_64
gem_platform: x86_64-linux
dockerfile: centos
- from_image: alpine
image_platform: linux/x86_64
gem_platform: x86_64-linux
dockerfile: alpine
- gem_platform: x86_64-linux

runs-on: ubuntu-latest
steps:
Expand All @@ -159,6 +181,7 @@ jobs:
name: binary-gem-${{ matrix.gem_platform }}
- name: Build image and Run tests
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker build --rm --platform ${{matrix.image_platform}} --build-arg from_image=${{matrix.from_image}} -t ruby-test -f spec/env/Dockerfile.${{matrix.dockerfile}} .
docker run --rm -t --network=host -v `pwd`:/build ruby-test
sudo apt-get install -y docker-compose
cp -v pg-*.gem misc/yugabyte/
cd misc/yugabyte
docker-compose up --abort-on-container-exit --exit-code-from pg
Loading

0 comments on commit 44e2cb8

Please sign in to comment.