Use cross-platform-actions for FreeBSD support. (#12732)

This change overcomes many stability issues experienced with the
vmactions action.

We need to limit VMs to 8GB for better stability, as the 13GB default
seems to hang them occasionally.

Shell code has been simplified since this action seem to use `bash -e`
which will abort on non-zero exit codes anyway.
This commit is contained in:
Yossi Gottlieb 2023-11-06 18:07:14 +02:00 committed by YaacovHazan
parent 52b6c0a27b
commit ffde2cf74d
2 changed files with 41 additions and 29 deletions

View File

@ -891,16 +891,20 @@ jobs:
repository: ${{ env.GITHUB_REPOSITORY }} repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }} ref: ${{ env.GITHUB_HEAD_REF }}
- name: test - name: test
uses: vmactions/freebsd-vm@v0.3.1 uses: cross-platform-actions/action@v0.21.1
env:
MAKE: gmake
with: with:
usesh: true operating_system: freebsd
sync: rsync environment_variables: MAKE
copyback: false version: 13.2
prepare: pkg install -y bash gmake lang/tcl86 lang/tclx memory: 8GB
run: > shell: bash
gmake || exit 1 ; run: |
if echo "${{github.event.inputs.skiptests}}" | grep -vq redis ; then ./runtest --verbose --timeout 2400 --no-latency --dump-logs ${{github.event.inputs.test_args}} || exit 1 ; fi ; sudo pkg install -y bash gmake lang/tcl86 lang/tclx
if echo "${{github.event.inputs.skiptests}}" | grep -vq modules ; then MAKE=gmake ./runtest-moduleapi --verbose --timeout 2400 --no-latency --dump-logs ${{github.event.inputs.test_args}} || exit 1 ; fi ; gmake
if echo "${{github.event.inputs.skiptests}}" | grep -vq redis ; then ./runtest --verbose --timeout 2400 --no-latency --dump-logs ${{github.event.inputs.test_args}} ; fi
if echo "${{github.event.inputs.skiptests}}" | grep -vq modules ; then ./runtest-moduleapi --verbose --timeout 2400 --no-latency --dump-logs ${{github.event.inputs.test_args}} ; fi
test-freebsd-sentinel: test-freebsd-sentinel:
runs-on: macos-12 runs-on: macos-12
@ -923,15 +927,16 @@ jobs:
repository: ${{ env.GITHUB_REPOSITORY }} repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }} ref: ${{ env.GITHUB_HEAD_REF }}
- name: test - name: test
uses: vmactions/freebsd-vm@v0.3.1 uses: cross-platform-actions/action@v0.21.1
with: with:
usesh: true operating_system: freebsd
sync: rsync version: 13.2
copyback: false memory: 8GB
prepare: pkg install -y bash gmake lang/tcl86 lang/tclx shell: bash
run: > run: |
gmake || exit 1 ; sudo pkg install -y bash gmake lang/tcl86 lang/tclx
if echo "${{github.event.inputs.skiptests}}" | grep -vq sentinel ; then ./runtest-sentinel ${{github.event.inputs.cluster_test_args}} || exit 1 ; fi ; gmake
if echo "${{github.event.inputs.skiptests}}" | grep -vq sentinel ; then ./runtest-sentinel ${{github.event.inputs.cluster_test_args}} ; fi
test-freebsd-cluster: test-freebsd-cluster:
runs-on: macos-12 runs-on: macos-12
@ -954,15 +959,16 @@ jobs:
repository: ${{ env.GITHUB_REPOSITORY }} repository: ${{ env.GITHUB_REPOSITORY }}
ref: ${{ env.GITHUB_HEAD_REF }} ref: ${{ env.GITHUB_HEAD_REF }}
- name: test - name: test
uses: vmactions/freebsd-vm@v0.3.1 uses: cross-platform-actions/action@v0.21.1
with: with:
usesh: true operating_system: freebsd
sync: rsync version: 13.2
copyback: false memory: 8GB
prepare: pkg install -y bash gmake lang/tcl86 lang/tclx shell: bash
run: > run: |
gmake || exit 1 ; sudo pkg install -y bash gmake lang/tcl86 lang/tclx
if echo "${{github.event.inputs.skiptests}}" | grep -vq cluster ; then ./runtest-cluster ${{github.event.inputs.cluster_test_args}} || exit 1 ; fi ; gmake
if echo "${{github.event.inputs.skiptests}}" | grep -vq cluster ; then ./runtest-cluster ${{github.event.inputs.cluster_test_args}} ; fi
test-alpine-jemalloc: test-alpine-jemalloc:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -300,15 +300,21 @@ start_server {tags {"info" "external:skip"}} {
test {stats: instantaneous metrics} { test {stats: instantaneous metrics} {
r config resetstat r config resetstat
after 1600 ;# hz is 10, wait for 16 cron tick so that sample array is fulfilled set retries 0
set value [s instantaneous_eventloop_cycles_per_sec] for {set retries 1} {$retries < 4} {incr retries} {
after 1600 ;# hz is 10, wait for 16 cron tick so that sample array is fulfilled
set value [s instantaneous_eventloop_cycles_per_sec]
if {$value > 0} break
}
assert_lessthan $retries 4
if {$::verbose} { puts "instantaneous metrics instantaneous_eventloop_cycles_per_sec: $value" } if {$::verbose} { puts "instantaneous metrics instantaneous_eventloop_cycles_per_sec: $value" }
assert_morethan $value 0 assert_morethan $value 0
assert_lessthan $value 15 ;# default hz is 10 assert_lessthan $value [expr $retries*15] ;# default hz is 10
set value [s instantaneous_eventloop_duration_usec] set value [s instantaneous_eventloop_duration_usec]
if {$::verbose} { puts "instantaneous metrics instantaneous_eventloop_duration_usec: $value" } if {$::verbose} { puts "instantaneous metrics instantaneous_eventloop_duration_usec: $value" }
assert_morethan $value 0 assert_morethan $value 0
assert_lessthan $value 22000 ;# default hz is 10, so duration < 1000 / 10, allow some tolerance assert_lessthan $value [expr $retries*22000] ;# default hz is 10, so duration < 1000 / 10, allow some tolerance
} }
test {stats: debug metrics} { test {stats: debug metrics} {