From 1a708ac17248ad91f83e6b8a05e3851aaabc92bf Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 23 Dec 2020 19:11:04 +0100 Subject: [PATCH] Also include one PR job that uses boringssl (#10886) Motivation: When validating PRs we should also at least run one job that uses boringssl Modifications: - Add job that uses boringssl - Cleanup docker compose files - Fix buffer leak in test Result: Also run with boringssl when PRs are validated --- .github/workflows/ci-pr.yml | 40 +++++++++++++++++++ docker/docker-compose.centos-6.110.yaml | 20 ---------- docker/docker-compose.centos-6.111.yaml | 7 +--- docker/docker-compose.centos-6.115.yaml | 7 +--- docker/docker-compose.centos-6.18.yaml | 15 +++---- .../docker-compose.centos-6.graalvm111.yaml | 9 +++-- docker/docker-compose.centos-6.graalvm18.yaml | 9 +++-- docker/docker-compose.centos-6.openj9111.yaml | 9 +++-- docker/docker-compose.yaml | 12 ++---- .../io/netty/handler/ssl/SslHandlerTest.java | 1 + 10 files changed, 73 insertions(+), 56 deletions(-) delete mode 100644 docker/docker-compose.centos-6.110.yaml diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 25614d6f86..0cbf52fbd3 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -152,3 +152,43 @@ jobs: with: name: target path: "**/target/" + + build-linux-x86_64-java11-boringssl: + runs-on: ubuntu-latest + needs: verify + steps: + - uses: actions/checkout@v2 + + # Cache .m2/repository + - uses: actions/cache@v2 + env: + cache-name: build-linux-x86_64-java11-boringssl-cache-m2-repository + with: + path: ~/.m2/repository + key: ${{ runner.os }}-pr-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-pr-${{ env.cache-name }}- + ${{ runner.os }}-pr- + + # Enable caching of Docker layers + - uses: satackey/action-docker-layer-caching@v0.0.8 + continue-on-error: true + with: + key: build-linux-x86_64-java11-boringssl-docker-cache-{hash} + restore-keys: | + build-linux-x86_64-java11-boringssl-docker-cache- + + - name: Build docker image + run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml build + + - name: Build project with leak detection + run: docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run build-leak-boringssl-static | tee build-leak.output + + - name: Checking for detected leak + run: ./.github/scripts/check_leak.sh build-leak.output + + - uses: actions/upload-artifact@v2 + if: ${{ failure() }} + with: + name: target + path: "**/target/" diff --git a/docker/docker-compose.centos-6.110.yaml b/docker/docker-compose.centos-6.110.yaml deleted file mode 100644 index c55fb0bd31..0000000000 --- a/docker/docker-compose.centos-6.110.yaml +++ /dev/null @@ -1,20 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: netty:centos-6-1.10 - build: - args: - java_version : "zulu@1.10.0-2" - - test: - image: netty:centos-6-1.10 - test-leak: - image: netty:centos-6-1.10 - - test-boringssl-static: - image: netty:centos-6-1.10 - - shell: - image: netty:centos-6-1.10 diff --git a/docker/docker-compose.centos-6.111.yaml b/docker/docker-compose.centos-6.111.yaml index 142f4ea046..1aaaa0efcd 100644 --- a/docker/docker-compose.centos-6.111.yaml +++ b/docker/docker-compose.centos-6.111.yaml @@ -14,13 +14,10 @@ services: build-leak: image: netty:centos-6-1.11 - test: + build-boringssl-static: image: netty:centos-6-1.11 - test-leak: - image: netty:centos-6-1.11 - - test-boringssl-static: + build-leak-boringssl-static: image: netty:centos-6-1.11 shell: diff --git a/docker/docker-compose.centos-6.115.yaml b/docker/docker-compose.centos-6.115.yaml index ce334122d0..6f7287d622 100644 --- a/docker/docker-compose.centos-6.115.yaml +++ b/docker/docker-compose.centos-6.115.yaml @@ -16,13 +16,10 @@ services: build-leak: image: netty:centos-6-1.15 - test: + build-boringssl-static: image: netty:centos-6-1.15 - test-leak: - image: netty:centos-6-1.15 - - test-boringssl-static: + build-leak-boringssl-static: image: netty:centos-6-1.15 shell: diff --git a/docker/docker-compose.centos-6.18.yaml b/docker/docker-compose.centos-6.18.yaml index 6dd4779b56..ff1aa5154c 100644 --- a/docker/docker-compose.centos-6.18.yaml +++ b/docker/docker-compose.centos-6.18.yaml @@ -14,17 +14,14 @@ services: build-leak: image: netty:centos-6-1.8 + build-boringssl-static: + image: netty:centos-6-1.8 + + build-leak-boringssl-static: + image: netty:centos-6-1.8 + deploy: image: netty:centos-6-1.8 - test: - image: netty:centos-6-1.8 - - test-leak: - image: netty:centos-6-1.8 - - test-boringssl-static: - image: netty:centos-6-1.8 - shell: image: netty:centos-6-1.8 diff --git a/docker/docker-compose.centos-6.graalvm111.yaml b/docker/docker-compose.centos-6.graalvm111.yaml index 8d960fe8dd..822a98e45f 100644 --- a/docker/docker-compose.centos-6.graalvm111.yaml +++ b/docker/docker-compose.centos-6.graalvm111.yaml @@ -8,13 +8,16 @@ services: args: java_version : "graalvm-ce-java11@20.1.0" - test: + build: image: netty:centos-6-1.11 - test-leak: + build-leak: image: netty:centos-6-1.11 - test-boringssl-static: + build-boringssl-static: + image: netty:centos-6-1.11 + + build-leak-boringssl-static: image: netty:centos-6-1.11 shell: diff --git a/docker/docker-compose.centos-6.graalvm18.yaml b/docker/docker-compose.centos-6.graalvm18.yaml index e314693863..d84cf11640 100644 --- a/docker/docker-compose.centos-6.graalvm18.yaml +++ b/docker/docker-compose.centos-6.graalvm18.yaml @@ -8,13 +8,16 @@ services: args: java_version : "graalvm-ce-java8@20.1.0" - test: + build: image: netty:centos-6-1.8 - test-leak: + build-leak: image: netty:centos-6-1.8 - test-boringssl-static: + build-boringssl-static: + image: netty:centos-6-1.8 + + build-leak-boringssl-static: image: netty:centos-6-1.8 shell: diff --git a/docker/docker-compose.centos-6.openj9111.yaml b/docker/docker-compose.centos-6.openj9111.yaml index d9680d69d0..c02a810cf6 100644 --- a/docker/docker-compose.centos-6.openj9111.yaml +++ b/docker/docker-compose.centos-6.openj9111.yaml @@ -8,13 +8,16 @@ services: args: java_version : "adopt-openj9@1.11.0-9" - test: + build: image: netty:centos-6-openj9-1.11 - test-leak: + build-leak: image: netty:centos-6-openj9-1.11 - test-boringssl-static: + build-boringssl-static: + image: netty:centos-6-openj9-1.11 + + build-leak-boringssl-static: image: netty:centos-6-openj9-1.11 shell: diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 3fd9ebe4d8..e2dc92fc10 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -30,17 +30,13 @@ services: <<: *common command: /bin/bash -cl "./mvnw clean deploy -DskipTests=true" - test-leak: + build-boringssl-static: <<: *common - command: /bin/bash -cl "./mvnw -Pleak clean install -Dio.netty.testsuite.badHost=netty.io -Dmaven.wagon.http.pool=false" + command: /bin/bash -cl "./mvnw -P boringssl clean install -Dio.netty.testsuite.badHost=netty.io -Dxml.skip=true" - test: + build-leak-boringssl-static: <<: *common - command: /bin/bash -cl "./mvnw clean install -Dio.netty.testsuite.badHost=netty.io -Dmaven.wagon.http.pool=false" - - test-boringssl-static: - <<: *common - command: /bin/bash -cl "./mvnw -P boringssl clean install -Dio.netty.testsuite.badHost=netty.io -Dxml.skip=true -Dmaven.wagon.http.pool=false" + command: /bin/bash -cl "./mvnw -Pboringssl,leak clean install -Dio.netty.testsuite.badHost=netty.io -Dxml.skip=true" shell: <<: *common diff --git a/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java b/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java index cc646d0570..d4cba7dd23 100644 --- a/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java @@ -1223,6 +1223,7 @@ public class SslHandlerTest { assertEquals(expected, buffer); } finally { expected.release(); + buffer.release(); } } else { throw (Throwable) obj;