From 40914adfb695840c17d7251c725bda09656e6efc Mon Sep 17 00:00:00 2001 From: edalex-ian <43919233+edalex-ian@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:22:22 +1100 Subject: [PATCH 01/18] test(GitHub CI): use G1GC We keep getting failed test runs on GitHub due to out of heap errors. One suggestion provided - by the JVM - is to try the G1GC garbage collector. --- autotest/.jvmopts | 1 + 1 file changed, 1 insertion(+) diff --git a/autotest/.jvmopts b/autotest/.jvmopts index 610e0fe681..c13c7c3dcd 100644 --- a/autotest/.jvmopts +++ b/autotest/.jvmopts @@ -2,3 +2,4 @@ -Xmx2048m -XX:ReservedCodeCacheSize=256m -XX:MaxMetaspaceSize=512m +-XX:+UseG1GC From 986b6886df91c39077bbe26f73c935e033d48bd0 Mon Sep 17 00:00:00 2001 From: edalex-ian <43919233+edalex-ian@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:30:17 +1100 Subject: [PATCH 02/18] ci(github): bump java to 21 --- .github/workflows/ci.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc64cfc668..8752ebe903 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,11 +53,11 @@ jobs: with: node-version-file: '.nvmrc' - - name: Set up JDK 11 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: adopt - java-version: 11 + java-version: 21 - name: Install node dependencies (oeq-rest-api) working-directory: oeq-ts-rest-api @@ -184,11 +184,11 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up JDK 11 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: adopt - java-version: 11 + java-version: 21 - name: Build working-directory: import-export-tool @@ -244,11 +244,11 @@ jobs: ffmpeg \ libimage-exiftool-perl - - name: Set up JDK 11 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: adopt - java-version: 11 + java-version: 21 - uses: actions/checkout@v4 @@ -369,11 +369,11 @@ jobs: ffmpeg \ libimage-exiftool-perl - - name: Set up JDK 11 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: adopt - java-version: 11 + java-version: 21 - name: Setup node uses: actions/setup-node@v3 From a5505f03456094dbae1336118223706584d63a72 Mon Sep 17 00:00:00 2001 From: edalex-ian <43919233+edalex-ian@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:41:42 +1100 Subject: [PATCH 03/18] ci(github): remove import/export tool build We have stopped building the import/export build due to the move to 21 not being supported by the gradle WSDL plugin. --- .github/workflows/ci.yaml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8752ebe903..445f010c3b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -179,28 +179,6 @@ jobs: name: Storybook path: react-front-end/storybook.tar - build_import_export_tool: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 21 - uses: actions/setup-java@v3 - with: - distribution: adopt - java-version: 21 - - - name: Build - working-directory: import-export-tool - run: | - ./gradlew build - - - name: Save primary artefacts - uses: actions/upload-artifact@v3.1.3 - with: - name: ImportExportTools - path: import-export-tool/build/libs/ - functional_testing: needs: build_and_check From 1060a1e8d44e6422bee20d2483f9ea914e1428a7 Mon Sep 17 00:00:00 2001 From: edalex-ian <43919233+edalex-ian@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:05:55 +1100 Subject: [PATCH 04/18] test(GitHub CI): increase max heap to 3GB --- autotest/.jvmopts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autotest/.jvmopts b/autotest/.jvmopts index c13c7c3dcd..830d22deb6 100644 --- a/autotest/.jvmopts +++ b/autotest/.jvmopts @@ -1,5 +1,5 @@ --Xms2048m --Xmx2048m +-Xms2g +-Xmx3g -XX:ReservedCodeCacheSize=256m -XX:MaxMetaspaceSize=512m -XX:+UseG1GC From 208ba1dc98b47ef45433e1d0d887167eccf901d3 Mon Sep 17 00:00:00 2001 From: edalex-ian <43919233+edalex-ian@users.noreply.github.com> Date: Mon, 8 Jan 2024 16:29:28 +1100 Subject: [PATCH 05/18] test(GitHub CI): remove memory pool tweaks --- autotest/.jvmopts | 2 -- 1 file changed, 2 deletions(-) diff --git a/autotest/.jvmopts b/autotest/.jvmopts index 830d22deb6..c776d9d4d3 100644 --- a/autotest/.jvmopts +++ b/autotest/.jvmopts @@ -1,5 +1,3 @@ -Xms2g -Xmx3g --XX:ReservedCodeCacheSize=256m --XX:MaxMetaspaceSize=512m -XX:+UseG1GC From afcd389fc7236948c1627ec1b02bf06779104dc7 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 9 Jan 2024 10:45:19 +1100 Subject: [PATCH 06/18] test(GitHub CI): log memory management --- .github/workflows/ci.yaml | 7 +++++++ autotest/.jvmopts | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 445f010c3b..c7460932a1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -313,6 +313,13 @@ jobs: name: CoverageReport-newui-${{ matrix.newui }} path: coverage_report.tar + - name: Save Memory Logs + if: failure() + uses: actions/upload-artifact@v3.1.3 + with: + name: memLogs-new_${{ matrix.newui }}-psql_${{ matrix.pgsql-image }} + path: /tmp/sbt* + rest-module-testing: needs: build_and_check diff --git a/autotest/.jvmopts b/autotest/.jvmopts index c776d9d4d3..d646dc2aff 100644 --- a/autotest/.jvmopts +++ b/autotest/.jvmopts @@ -1,3 +1,7 @@ -Xms2g -Xmx3g -XX:+UseG1GC +-Xlog:gc*:file=/tmp/sbt-gc-%t.log:tags,time,uptime,level:filecount=10,filesize=2M +-XX:+HeapDumpOnOutOfMemoryError +-XX:HeapDumpPath=/tmp/sbt-.hprof +-XX:+UseGCOverheadLimit From 840512111f6185cd3aa9459257b5e366efdff319 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 9 Jan 2024 10:55:20 +1100 Subject: [PATCH 07/18] test(GitHub CI): fix format issue in ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c7460932a1..9b3dc3076e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -313,7 +313,7 @@ jobs: name: CoverageReport-newui-${{ matrix.newui }} path: coverage_report.tar - - name: Save Memory Logs + - name: Save Memory Logs if: failure() uses: actions/upload-artifact@v3.1.3 with: From e6d08f0b2e9b09e6a49f565c6696c19dd140edc1 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 9 Jan 2024 12:23:40 +1100 Subject: [PATCH 08/18] test(GitHub CI): fix specification of pid for heapdump Seems the syntax I was using was wrong to get the PID into the filename for the heap dump. This change is based on the doco for HeapDumpPath at: https://docs.oracle.com/en/java/javase/21/docs/specs/man/java.html --- autotest/.jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autotest/.jvmopts b/autotest/.jvmopts index d646dc2aff..b4ba4d0ea4 100644 --- a/autotest/.jvmopts +++ b/autotest/.jvmopts @@ -3,5 +3,5 @@ -XX:+UseG1GC -Xlog:gc*:file=/tmp/sbt-gc-%t.log:tags,time,uptime,level:filecount=10,filesize=2M -XX:+HeapDumpOnOutOfMemoryError --XX:HeapDumpPath=/tmp/sbt-.hprof +-XX:HeapDumpPath=/tmp/sbt-%p.hprof -XX:+UseGCOverheadLimit From eb3e6aceaf19d074db5fdf2473b756a35b5712e9 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 9 Jan 2024 15:45:14 +1100 Subject: [PATCH 09/18] test(GitHub CI): remove specification of pid for heapdump Seems that doesn't work either, so I give up. --- autotest/.jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autotest/.jvmopts b/autotest/.jvmopts index b4ba4d0ea4..fbc6752782 100644 --- a/autotest/.jvmopts +++ b/autotest/.jvmopts @@ -3,5 +3,5 @@ -XX:+UseG1GC -Xlog:gc*:file=/tmp/sbt-gc-%t.log:tags,time,uptime,level:filecount=10,filesize=2M -XX:+HeapDumpOnOutOfMemoryError --XX:HeapDumpPath=/tmp/sbt-%p.hprof +-XX:HeapDumpPath=/tmp/sbt.hprof -XX:+UseGCOverheadLimit From 1d99119b1001c46870d21702c9c52351c42589c9 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 9 Jan 2024 16:30:05 +1100 Subject: [PATCH 10/18] build: upgrade SBT wrapper --- sbt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbt b/sbt index 4ee84afcfc..f63a9ee5a7 100755 --- a/sbt +++ b/sbt @@ -34,11 +34,11 @@ set -o pipefail -declare -r sbt_release_version="1.5.6" -declare -r sbt_unreleased_version="1.6.0-M1" +declare -r sbt_release_version="1.9.7" +declare -r sbt_unreleased_version="1.9.7" -declare -r latest_213="2.13.7" -declare -r latest_212="2.12.15" +declare -r latest_213="2.13.12" +declare -r latest_212="2.12.18" declare -r latest_211="2.11.12" declare -r latest_210="2.10.7" declare -r latest_29="2.9.3" From af727a6eb35008ba9a5600bc30eba62aa15ed8a1 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 9 Jan 2024 16:30:39 +1100 Subject: [PATCH 11/18] ci(GitHub): use java action v4 with temurin --- .github/workflows/ci.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9b3dc3076e..0beaaaf724 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -54,9 +54,9 @@ jobs: node-version-file: '.nvmrc' - name: Set up JDK 21 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: temurin java-version: 21 - name: Install node dependencies (oeq-rest-api) @@ -223,9 +223,9 @@ jobs: libimage-exiftool-perl - name: Set up JDK 21 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: temurin java-version: 21 - uses: actions/checkout@v4 @@ -355,9 +355,9 @@ jobs: libimage-exiftool-perl - name: Set up JDK 21 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: adopt + distribution: temurin java-version: 21 - name: Setup node From 7109234f448a5668a2327185c89fdf8494a00f06 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 9 Jan 2024 16:34:54 +1100 Subject: [PATCH 12/18] build: remove autotest/.jvmopts This was actually being partially overridden by the root .sbtopts. So let's try and standardise on just one to avoid confusion. --- .github/workflows/ci.yaml | 16 ++++++---------- .sbtopts | 2 +- autotest/.jvmopts | 7 ------- 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 autotest/.jvmopts diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0beaaaf724..1a1a942e72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -252,15 +252,14 @@ jobs: - name: Setup for tests run: | - ./sbt -jvm-opts autotest/.jvmopts "project autotest" \ + ./sbt "project autotest" \ installEquella startEquella configureInstall setupForTests - name: Run Scalacheck tests # We only need to run these once, so we focus on the New UI if: matrix.newui run: | - ./sbt -jvm-opts autotest/.jvmopts "project autotest" \ - Tests/test Tests/Serial/test dumpCoverage + ./sbt "project autotest" Tests/test Tests/Serial/test dumpCoverage - name: Save Scalacheck results if: matrix.newui && failure() @@ -271,8 +270,7 @@ jobs: - name: Run TestNG tests run: | - ./sbt -jvm-opts autotest/.jvmopts "project autotest" \ - OldTests/test dumpCoverage + ./sbt "project autotest" OldTests/test dumpCoverage - name: Save TestNG Reports if: failure() @@ -297,8 +295,7 @@ jobs: - name: Generate coverage report run: | - ./sbt -jvm-opts autotest/.jvmopts "project autotest" \ - coverageReport + ./sbt "project autotest" coverageReport # To save significant time on file upload, we first tar up the directory # as it contains > 10k files and the artefact upload was taking almost @@ -382,7 +379,7 @@ jobs: - name: Install openEquella run: | - ./sbt -jvm-opts autotest/.jvmopts "project autotest" \ + ./sbt "project autotest" \ installEquella startEquella configureInstall setupForTests - name: Run tests @@ -393,8 +390,7 @@ jobs: - name: Stop oEQ if: failure() run: | - ./sbt -jvm-opts autotest/.jvmopts "project autotest" \ - stopEquella + ./sbt "project autotest" stopEquella - name: Save oEQ logs for REST Module if: failure() diff --git a/.sbtopts b/.sbtopts index 2b63e3b2d8..1ca6d0b39d 100644 --- a/.sbtopts +++ b/.sbtopts @@ -1 +1 @@ --J-Xmx4G +-J-Xmx2G diff --git a/autotest/.jvmopts b/autotest/.jvmopts deleted file mode 100644 index fbc6752782..0000000000 --- a/autotest/.jvmopts +++ /dev/null @@ -1,7 +0,0 @@ --Xms2g --Xmx3g --XX:+UseG1GC --Xlog:gc*:file=/tmp/sbt-gc-%t.log:tags,time,uptime,level:filecount=10,filesize=2M --XX:+HeapDumpOnOutOfMemoryError --XX:HeapDumpPath=/tmp/sbt.hprof --XX:+UseGCOverheadLimit From a79c1518de5312c2300703b98d029e48c29ba3b7 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Mon, 15 Jan 2024 12:22:07 +1100 Subject: [PATCH 13/18] build: move from .sbtopts to .jvmopts As the main settings we want to play with a are JVM focused, and this makes it easier to specify them. --- .jvmopts | 4 ++++ .sbtopts | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .jvmopts delete mode 100644 .sbtopts diff --git a/.jvmopts b/.jvmopts new file mode 100644 index 0000000000..610e0fe681 --- /dev/null +++ b/.jvmopts @@ -0,0 +1,4 @@ +-Xms2048m +-Xmx2048m +-XX:ReservedCodeCacheSize=256m +-XX:MaxMetaspaceSize=512m diff --git a/.sbtopts b/.sbtopts deleted file mode 100644 index 1ca6d0b39d..0000000000 --- a/.sbtopts +++ /dev/null @@ -1 +0,0 @@ --J-Xmx2G From f2325c65434011ad5ad8a34a1f16fa7eff7e5f44 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Mon, 15 Jan 2024 15:38:43 +1100 Subject: [PATCH 14/18] test(GitHub CI): disable TestNG HTML logs There's reports around the internet that the generation of these are known to cause memory issues. --- autotest/OldTests/build.sbt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autotest/OldTests/build.sbt b/autotest/OldTests/build.sbt index 95bfcb60cb..b022947d36 100644 --- a/autotest/OldTests/build.sbt +++ b/autotest/OldTests/build.sbt @@ -24,6 +24,8 @@ enablePlugins(TestNGPlugin) testNGOutputDirectory := (target.value / "testng").absolutePath testNGParameters ++= Seq("-log", autotestBuildConfig.value.getInt("tests.verbose").toString) +// Disable generating the HTML report, as it's running out of memory on GitHub Actions. +testNGParameters ++= Seq("-usedefaultlisteners", "false") testNGSuites := { val tc = autotestBuildConfig.value.getConfig("tests") From b7c3b321ec1bde1b53c76b86d9801c9422ed02be Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Thu, 18 Jan 2024 10:41:52 +1100 Subject: [PATCH 15/18] Revert "test(GitHub CI): disable TestNG HTML logs" This reverts commit f2325c65434011ad5ad8a34a1f16fa7eff7e5f44. It didn't seem to make any difference - other than different (unhelpful) runtime output. Seeing the change removes all listeners, maybe I needed to add a basic listener back in. --- autotest/OldTests/build.sbt | 2 -- 1 file changed, 2 deletions(-) diff --git a/autotest/OldTests/build.sbt b/autotest/OldTests/build.sbt index b022947d36..95bfcb60cb 100644 --- a/autotest/OldTests/build.sbt +++ b/autotest/OldTests/build.sbt @@ -24,8 +24,6 @@ enablePlugins(TestNGPlugin) testNGOutputDirectory := (target.value / "testng").absolutePath testNGParameters ++= Seq("-log", autotestBuildConfig.value.getInt("tests.verbose").toString) -// Disable generating the HTML report, as it's running out of memory on GitHub Actions. -testNGParameters ++= Seq("-usedefaultlisteners", "false") testNGSuites := { val tc = autotestBuildConfig.value.getConfig("tests") From 21dfc81127d95bb64e558614b2b963b58d402185 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 30 Jan 2024 11:13:20 +1100 Subject: [PATCH 16/18] ci(github): remove step to save memory logs These are no longer being produced. --- .github/workflows/ci.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1a1a942e72..477e130649 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -310,13 +310,6 @@ jobs: name: CoverageReport-newui-${{ matrix.newui }} path: coverage_report.tar - - name: Save Memory Logs - if: failure() - uses: actions/upload-artifact@v3.1.3 - with: - name: memLogs-new_${{ matrix.newui }}-psql_${{ matrix.pgsql-image }} - path: /tmp/sbt* - rest-module-testing: needs: build_and_check From 32743347666d8f77012b267d4ca24005ae120b8d Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Tue, 30 Jan 2024 17:26:16 +1100 Subject: [PATCH 17/18] build(sbt): bump max heap to 3g --- .jvmopts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jvmopts b/.jvmopts index 610e0fe681..ea2678403f 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xms2048m --Xmx2048m +-Xms2g +-Xmx3g -XX:ReservedCodeCacheSize=256m -XX:MaxMetaspaceSize=512m From 8e540accb7432ac8fcf2e56b1869e8d54f9506d9 Mon Sep 17 00:00:00 2001 From: Ian Stevenson Date: Wed, 31 Jan 2024 09:35:41 +1100 Subject: [PATCH 18/18] build(sbt): bump max heap to 4g PortalTest and AdvancedSearchPageTest are both flaking. They used to be fine, and due to the old setup with the `.sbtopts` file the max heap was actually always at 4G so might as well try returning to that. --- .jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jvmopts b/.jvmopts index ea2678403f..3035c6fe36 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ -Xms2g --Xmx3g +-Xmx4g -XX:ReservedCodeCacheSize=256m -XX:MaxMetaspaceSize=512m