Skip to content

Commit

Permalink
run the test suite against the early access jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Oct 25, 2023
1 parent ef0e566 commit 3818788
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 5 deletions.
171 changes: 171 additions & 0 deletions .github/workflows/early-access.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: early-access
permissions: read-all
on: [ push ]

env:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
ALLOWED_ENDPOINTS: >
api.adoptium.net:443
api.github.com:443
api.snapcraft.io:443
artifactcache.actions.githubusercontent.com:443
caffeine.gradle-enterprise.cloud:443
cdn.azul.com:443
cloudflare.com:443
docker.io:443
download.java.net:443
download.oracle.com:443
downloads.gradle.org:443
downloads.gradle-dn.com:443
gds.oracle.com:443
ghcr.io:443
github.com:443
jdk.java.net:443
jcenter.bintray.com:443
objects.githubusercontent.com:443
oss.sonatype.org:443
pipelines.actions.githubusercontent.com:443
plugins.gradle.org:443
plugins-artifacts.gradle.org:443
raw.githubusercontent.com:443
registry.npmjs.org:443
repo.gradle.org:443
repo.maven.apache.org:443
repo1.maven.org:443
scans-in.gradle.com:443
services.gradle.org:443
schemastore.org:443
www.graalvm.org:443
jobs:
tests:
name: Tests
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
suite:
- caffeine:weakKeysAndStrongValuesStatsAsyncCaffeineSlowTest
- caffeine:weakKeysAndStrongValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndSoftValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsAsyncCaffeineTest
- caffeine:weakKeysAndWeakValuesStatsSyncCaffeineSlowTest
- caffeine:weakKeysAndSoftValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesStatsSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesStatsAsyncCaffeineTest
- caffeine:strongKeysAndWeakValuesStatsSyncGuavaSlowTest
- caffeine:strongKeysAndSoftValuesStatsSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesAsyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndWeakValuesStatsSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndSoftValuesStatsSyncGuavaSlowTest
- caffeine:strongKeysAndWeakValuesSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsSyncGuavaTest
- caffeine:strongKeysAndSoftValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndWeakValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesStatsSyncCaffeineTest
- caffeine:strongKeysAndStrongValuesAsyncCaffeineTest
- caffeine:weakKeysAndWeakValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndStrongValuesStatsSyncGuavaTest
- caffeine:weakKeysAndSoftValuesSyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncGuavaTest
- caffeine:strongKeysAndStrongValuesSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesStatsSyncGuavaTest
- caffeine:weakKeysAndStrongValuesSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesAsyncCaffeineTest
- caffeine:strongKeysAndWeakValuesSyncGuavaSlowTest
- caffeine:strongKeysAndSoftValuesSyncGuavaSlowTest
- caffeine:weakKeysAndWeakValuesStatsSyncGuavaTest
- caffeine:weakKeysAndStrongValuesSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesStatsSyncGuavaTest
- caffeine:strongKeysAndWeakValuesSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesSyncCaffeineTest
- caffeine:weakKeysAndWeakValuesSyncGuavaSlowTest
- caffeine:weakKeysAndSoftValuesSyncGuavaSlowTest
- caffeine:strongKeysAndStrongValuesSyncGuavaTest
- caffeine:weakKeysAndWeakValuesSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesSyncGuavaTest
- caffeine:strongKeysAndWeakValuesSyncGuavaTest
- caffeine:strongKeysAndSoftValuesSyncGuavaTest
- caffeine:weakKeysAndWeakValuesSyncGuavaTest
- caffeine:weakKeysAndSoftValuesSyncGuavaTest
- caffeine:lincheckTest
- caffeine:isolatedTest
- caffeine:junitTest
- simulator:check
- jcache:check
- guava:check
java: [ 22 ]
env:
JAVA_VERSION: ${{ matrix.java }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: ${{ env.ALLOWED_ENDPOINTS }}
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run tests (${{ matrix.suite }})
uses: ./.github/actions/run-gradle
with:
java: ${{ matrix.java }}
arguments: ${{ matrix.suite }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Format Test Artifact Name
run: |
RAW_NAME=${{ matrix.suite }}-${{ env.JAVA_VERSION }}
ARTIFACT_NAME=$(echo $RAW_NAME | sed 's/:/-/g')
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
- name: Compress test results
run: >
find . -path */jacoco/*.exec -o -path */results/*.xml
| tar czf ${{ env.ARTIFACT_NAME }}.tar.gz --files-from -
- name: Upload test results
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
retention-days: 1
name: ${{ env.ARTIFACT_NAME }}-results
path: ${{ env.ARTIFACT_NAME }}.tar.gz
- name: Cancel if failed
uses: andymckay/cancel-action@b9280e3f8986d7a8e91c7462efc0fa318010c8b1 # 0.3
continue-on-error: true
if: failure()

test-results:
name: Test Results
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'push'
permissions:
checks: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
${{ env.ALLOWED_ENDPOINTS }}
- name: Download Tests
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
- name: Decompress
run: find . -type f -name '*.tar.gz' -exec sh -c 'tar -zxf {} --one-top-level' \;
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@ca89ad036b5fcd524c1017287fb01b5139908408 # v2.11.0
continue-on-error: true
id: test-results
with:
json_thousands_separator: ','
junit_files: '**/TEST-*.xml'
comment_mode: off
ignore_runs: true
job_summary: true
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.AbstractSet;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
Expand Down Expand Up @@ -119,7 +118,7 @@ default CompletableFuture<Map<K, V>> getAll(Iterable<? extends K> keys,

int initialCapacity = calculateHashMapCapacity(keys);
var futures = new LinkedHashMap<K, CompletableFuture<V>>(initialCapacity);
var proxies = new HashMap<K, CompletableFuture<V>>(initialCapacity);
var proxies = new LinkedHashMap<K, CompletableFuture<V>>(initialCapacity);
for (K key : keys) {
if (futures.containsKey(key)) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,10 @@ public void getAllBifunction_early_success(AsyncCache<Int, Int> cache, CacheCont
var bulk = new CompletableFuture<Map<Int, Int>>();
var result = cache.getAll(context.absentKeys(), (keysToLoad, executor) -> bulk);
var future = cache.asMap().get(key);

future.complete(value);
bulk.complete(context.absent()); // obtrudes the future's value

bulk.complete(context.absent());
assertThat(future).succeedsWith(context.absent().get(key));
assertThat(result.join()).containsExactlyEntriesIn(context.absent());
assertThat(cache.synchronous().asMap()).containsAtLeastEntriesIn(context.absent());
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ google-java-format = "1.18.1"
guava = "32.1.3-jre"
guice = "6.0.0"
hamcrest = "2.2"
hazelcast = "5.3.4"
hazelcast = "5.3.5"
httpclient = "4.5.14"
jackrabbit = "1.58.0"
jackson = "2.15.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
}

tasks.withType<Test>().configureEach {
jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=0")
jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=0", "-XX:+EnableDynamicAgentLoading", "-Xshare:off")
if ("debug" in systemProperties) {
jvmArgs("-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005")
}
Expand Down

0 comments on commit 3818788

Please sign in to comment.