Skip to content

Commit

Permalink
run the test suite against the latest jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Oct 26, 2023
1 parent 2995ea8 commit f6e4f73
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: build
on:
pull_request: {}
push:
branches: [master, v2.dev, v3.dev]
permissions: read-all
on: [ push, pull_request ]

env:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
Expand Down Expand Up @@ -60,13 +63,13 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Prepare GraalVM
if: matrix.java == 'GraalVM'
if: env.JAVA_VERSION == 'GraalVM'
shell: bash
run: echo "GRADLE_ARGS=--no-build-cache" >> $GITHUB_ENV
- name: Compile
uses: ./.github/actions/run-gradle
with:
java: ${{ matrix.java }}
java: ${{ env.JAVA_VERSION }}
early-access: ${{ env.EA_JDK }}
token: ${{ secrets.GITHUB_TOKEN }}
arguments: check -x test ${{ env.GRADLE_ARGS }}
Expand Down Expand Up @@ -139,7 +142,7 @@ jobs:
- simulator:check
- jcache:check
- guava:check
java: [ 11 ]
java: [ 11, 21 ]
env:
JAVA_VERSION: ${{ matrix.java }}
steps:
Expand All @@ -151,10 +154,11 @@ jobs:
allowed-endpoints: ${{ env.ALLOWED_ENDPOINTS }}
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run tests (${{ matrix.suite }})
- name: Run tests (${{ env.JAVA_VERSION }})
uses: ./.github/actions/run-gradle
if: (env.JAVA_VERSION == env.PUBLISH_JDK) || !contains(matrix.suite, 'Guava')
with:
java: ${{ matrix.java }}
java: ${{ env.JAVA_VERSION }}
arguments: ${{ matrix.suite }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Format Test Artifact Name
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ tasks.withType<JavaCompile>().configureEach {
languageVersion = java.toolchain.languageVersion
}

options.compilerArgs.addAll(listOf("-proc:full", "-Xmaxerrs", "500", "-Xmaxwarns", "500"))
options.compilerArgs.add("-Xlint:all,-processing,-exports,-auxiliaryclass,"
+ "-requires-automatic,-requires-transitive-automatic")
options.compilerArgs.addAll(listOf("-Xmaxerrs", "500", "-Xmaxwarns", "500"))
options.encoding = "UTF-8"
}

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 f6e4f73

Please sign in to comment.