From 508be1b19adea63d4c33aa0eb54a3dc1fe418c73 Mon Sep 17 00:00:00 2001 From: Erik Berlin Date: Mon, 26 Oct 2026 09:01:22 -0700 Subject: [PATCH] Start the JRuby jobs first, with --dev and a timeout The JRuby test jobs took up to 25 minutes, starting a JVM for each of the many Ruby processes the tests run, and finished long after the rest. They're listed first in each matrix now, so they start before the others, and run with JRUBY_OPTS=--dev, which starts each process faster. Each test job also has a timeout, so a hang fails in minutes instead of running for six hours. --- .github/workflows/plugin-activerecord.yml | 7 ++++++- .github/workflows/plugin-gvl.yml | 7 ++++++- .github/workflows/plugin-memcached.yml | 7 ++++++- .github/workflows/plugin-mysql.yml | 7 ++++++- .github/workflows/plugin-postgresql.yml | 7 ++++++- .github/workflows/plugin-redis.yml | 7 ++++++- .github/workflows/plugin-retained.yml | 7 ++++++- .github/workflows/test.yml | 7 ++++++- 8 files changed, 48 insertions(+), 8 deletions(-) diff --git a/.github/workflows/plugin-activerecord.yml b/.github/workflows/plugin-activerecord.yml index de37515..503cb96 100644 --- a/.github/workflows/plugin-activerecord.yml +++ b/.github/workflows/plugin-activerecord.yml @@ -35,6 +35,8 @@ jobs: # (Nightly, only the comparison with the last release runs.) if: github.event_name != 'schedule' runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 20 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} @@ -44,7 +46,8 @@ jobs: # JRuby runs the tests on SQLite through JDBC (it can't build the # sqlite3 gem, a C extension), whose adapter holds Active Record # to 7.2 there (the plugin itself is plain Ruby). - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] activerecord: [">= 7.2"] include: - ruby-version: "3.4" @@ -67,6 +70,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure' diff --git a/.github/workflows/plugin-gvl.yml b/.github/workflows/plugin-gvl.yml index 75d7c9d..6db8c62 100644 --- a/.github/workflows/plugin-gvl.yml +++ b/.github/workflows/plugin-gvl.yml @@ -35,13 +35,16 @@ jobs: # (Nightly, only the comparison with the last release runs.) if: github.event_name != 'schedule' runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 20 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} strategy: fail-fast: false matrix: - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] steps: - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 @@ -58,6 +61,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure' diff --git a/.github/workflows/plugin-memcached.yml b/.github/workflows/plugin-memcached.yml index 04a2e16..a66e64d 100644 --- a/.github/workflows/plugin-memcached.yml +++ b/.github/workflows/plugin-memcached.yml @@ -35,13 +35,16 @@ jobs: # (Nightly, only the comparison with the last release runs.) if: github.event_name != 'schedule' runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 20 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} strategy: fail-fast: false matrix: - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] steps: - uses: actions/checkout@v7 - run: sudo apt-get install -y memcached @@ -57,6 +60,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure' diff --git a/.github/workflows/plugin-mysql.yml b/.github/workflows/plugin-mysql.yml index e8771ff..ca5ccae 100644 --- a/.github/workflows/plugin-mysql.yml +++ b/.github/workflows/plugin-mysql.yml @@ -35,6 +35,8 @@ jobs: # (Nightly, only the comparison with the last release runs.) if: github.event_name != 'schedule' runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 20 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} @@ -44,7 +46,8 @@ jobs: # (On TruffleRuby the gem installs, but the tests skip: 40.0 fails # inside Trilogy#query, "dead handle", within a thousand or so # queries.) - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] exclude: # The trilogy gem, a runtime dependency, is a C extension: it # doesn't install on JRuby. @@ -73,6 +76,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure' diff --git a/.github/workflows/plugin-postgresql.yml b/.github/workflows/plugin-postgresql.yml index 81564ed..66f85f4 100644 --- a/.github/workflows/plugin-postgresql.yml +++ b/.github/workflows/plugin-postgresql.yml @@ -35,13 +35,16 @@ jobs: # (Nightly, only the comparison with the last release runs.) if: github.event_name != 'schedule' runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 20 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} strategy: fail-fast: false matrix: - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] exclude: # The pg gem, a runtime dependency, is a C extension: it doesn't # install on JRuby. @@ -65,6 +68,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure' diff --git a/.github/workflows/plugin-redis.yml b/.github/workflows/plugin-redis.yml index 364eb09..c7058fe 100644 --- a/.github/workflows/plugin-redis.yml +++ b/.github/workflows/plugin-redis.yml @@ -35,13 +35,16 @@ jobs: # (Nightly, only the comparison with the last release runs.) if: github.event_name != 'schedule' runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 20 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} strategy: fail-fast: false matrix: - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] steps: - uses: actions/checkout@v7 - run: sudo apt-get install -y redis-server @@ -57,6 +60,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure' diff --git a/.github/workflows/plugin-retained.yml b/.github/workflows/plugin-retained.yml index 3fcf98d..94b0940 100644 --- a/.github/workflows/plugin-retained.yml +++ b/.github/workflows/plugin-retained.yml @@ -35,6 +35,8 @@ jobs: # (Nightly, only the comparison with the last release runs.) if: github.event_name != 'schedule' runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 20 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} @@ -44,7 +46,8 @@ jobs: # JRuby and TruffleRuby: the metric leaves itself out there, and # the tests check that a comparison still runs (skipping those # that measure, with the reason). - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] steps: - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 @@ -59,6 +62,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df7c01a..fe8f5a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,13 +22,16 @@ jobs: test: name: ${{ matrix.ruby-version }} runs-on: ubuntu-latest + # A hang fails the job, rather than running for GitHub's six hours + timeout-minutes: 45 # The development versions (Ruby's, JRuby's and TruffleRuby's) get an # early look, but can't fail the build. continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} strategy: fail-fast: false matrix: - ruby-version: ["3.4", "4.0", "ruby-head", "jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head"] + # The slowest first, so they start before the rest of the queue + ruby-version: ["jruby-10.0", "jruby-10.1", "jruby-head", "truffleruby-head", "3.4", "4.0", "ruby-head"] steps: - uses: actions/checkout@v7 - uses: ruby/setup-ruby@v1 @@ -42,6 +45,8 @@ jobs: continue-on-error: ${{ endsWith(matrix.ruby-version, '-head') }} env: COVERAGE: "false" + # JRuby's --dev starts each process faster, and the tests start many + JRUBY_OPTS: ${{ startsWith(matrix.ruby-version, 'jruby') && '--dev' || '' }} run: bundle exec rake test - name: Note an advisory failure if: steps.tests.outcome == 'failure'