Conversation
… and fix TraceWriterMemoryTest flake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces noisy build/test warnings, uncaught background-thread exceptions, and excessive test log spam while speeding up Surefire test execution and GitHub Actions CI across all 4 JDKs (17, 21, 25, 28-ea).
Measured Gains (Before vs. After on GitHub Actions CI)
##[error]annotationsException in threadpush+pull_request)pull_requestonly)api_devtest suite duration (5,008 tests)external/geronimo_javamailtest durationreuseForks=true)apitest durationreuseForks=true)Sharing is only supportedwarningsrestricted method in java.lang.Systemsun.misc.Unsafe::arrayBaseOffsetwarnings"CST"timezone warnings[MockitoHint] Unusedstubbing warningsprotocjava_generic_serviceswarningsappengine-api-stubsJavadoc warningsGMTransportTestDEBUG: getProvider()linesApiCallsTestper-RPCINFOlog spamInterruptedApiCallTestwarning stack tracesLocalDatastoreService.initINFOlogsDetailed Changes
java_generic_servicesdeprecation warnings:option java_generic_services = true;fromcapability_service.proto,images_service.proto,memcache_service.proto, andurlfetch_service.proto.-Xshare:off,--enable-native-access=ALL-UNNAMED,--sun-misc-unsafe-memory-access=allow, Mockito agent, andCSTtimezone):-Xshare:offand--enable-native-access=ALL-UNNAMEDto the rootmaven-surefire-plugin<argLine>, eliminatingSharing is only supported for boot loader classesand JDK 24+ restricted native access warnings across forked test JVMs.surefire-jdk24plusprofile (<jdk>[24,)</jdk>) setting--sun-misc-unsafe-memory-access=allow(and pass it inJavaRuntimeViaHttpBase.optionalFlags()whenRuntime.version().feature() >= 24) to silencesun.misc.Unsafe::arrayBaseOffsetwarnings fromprotobuf-javaon JDK 25 and 28-ea while remaining compatible with JDK 17 and 21.appengine_testing_tests/pom.xml,applications/guestbook/pom.xml,applications/guestbook_jakarta/pom.xml, andapplications/jaxrs/pom.xmlSurefire<argLine>configurations to include-Xshare:off,--enable-native-access=ALL-UNNAMED,${surefire.unsafe.arg},-javaagent:${org.mockito:mockito-core:jar}, and replace deprecated-Duser.timezone=CSTwith-Duser.timezone=America/Chicago.reuseForks&forkCount):<reuseForks>true</reuseForks>inexternal/geronimo_javamailandapi.<forkCount>2</forkCount>inapi_dev(preserving<reuseForks>false</reuseForks>process isolation per test class while running 2 forks in parallel, cuttingapi_devtest time from ~6m to ~2m).No SLF4J providers were foundwarnings:org.slf4j:slf4j-nop(<scope>test</scope>) toapi,api_dev,appengine_testing_tests, andruntime/test.-source/-targetwarnings:Application.compileJspJavaFilesinlib/tools_apito pass--release <javaVersion> -Xlint:-optionsinstead of-source/-target.[MockitoHint] Unusedstubbing warnings:ImagesServiceImplTest,AdminDatastoreServiceTest,BlobstoreServiceImplTest,DatastoreCallbacksTest,GCacheTest, andruntime_impl_jetty12'sFileSenderTest.GMTransportTest: Removemail.debug=trueand set explicitContent-Transfer-Encodingheaders on non-Stringtext/plainparts soDataHandler.getInputStreambackground threads don't throwClassCastExceptioninTextHandler.writeTo.ApiProxyImplTest: Iterate over a snapshot copy (new ArrayList<>(futures)) when cancelling futures so synchronous cancellation listeners don't triggerConcurrentModificationExceptionon background threads.HttpApiProxyImplTestBase: Restore thread interrupt status (Thread.currentThread().interrupt()) instead of throwing an uncaughtRuntimeException(InterruptedException)whenFakeHttpApiHoststops after timeout tests (eliminating all##[error] sleep interruptedannotations on GitHub Actions).TraceWriterMemoryTest: Measure actual used heap memory (runtime.totalMemory() - runtime.freeMemory()) instead ofruntime.freeMemory()so G1GC committed-heap expansion does not cause false-positive failures on JDK 28-ea.ApiCallsTest: Pass-Ddisable_api_call_logging_in_apiproxy=trueviaGAE_JAVA_OPTSto suppress ~21,000 lines of per-RPCINFOlog spam during the 4,400-RPC concurrency/stress tests.InterruptedApiCallTest: Temporarily setApiProxyImpllogger level toSEVEREduring the 1,000-interrupt spray loop to suppress ~11,000 lines of expectedInterruptedExceptionstack traces.LocalImagesService,LocalDatastoreService, andLocalSearchService: Log initialization/missing-format messages atINFO/WARNINGonce per JVM andFINEthereafter in tests (eliminating ~6,700 lines of repetitive service init logs).api_dev: Fix 5 malformed/unresolved Javadoc tags ({@local},{@Link},{@CapabilityStatus}, unqualified{@link Logger}and{@link LocalURLFetchService}) soappengine-api-stubsbuilds with 0 Javadoc warnings.maven.yml):actions/checkoutandactions/setup-javato SHA-pinnedv5releases and add top-levelpermissions: contents: read(satisfyingzizmor).push:trigger tomain(avoiding duplicate 8-jobpush+pull_requestruns on PR branches) and add aconcurrencygroup withcancel-in-progress: true.