quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

Build cache sometimes prevents rerunning integration tests #43584

Closed sberyozkin closed 1 month ago

sberyozkin commented 1 month ago

Describe the bug

I've been seeing it periodically, sometimes, I just can't get the tests running again, for example:

$ mvn clean install
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------< io.quarkus:quarkus-integration-test-oidc-wiremock >----------
[INFO] Building Quarkus - Integration Tests - OpenID Connect Adapter WireMock 999-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (clean-cache-dirs) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Deleting .../quarkus/integration-tests/oidc-wiremock/target
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ quarkus-integration-test-oidc-wiremock ---
[INFO] 
[INFO] --- enforcer:3.3.0:enforce (enforce) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 0.295s
[INFO] 
[INFO] --- properties:1.1.0:set-system-properties (default) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Set 1 system property
[INFO] 
[INFO] --- buildnumber:3.0.0:create (get-scm-revision) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Executing: /bin/sh -c cd '.../quarkus/integration-tests/oidc-wiremock' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /home/.../quarkus/integration-tests/oidc-wiremock
[INFO] Storing buildNumber: d8ff7e44bd038dcc8c35278df9cd03799819e505 at timestamp: 1727644687257
[INFO] Storing buildScmBranch: oidc_self_signed_idtoken_check
[INFO] 
[INFO] --- formatter:2.24.1:format (default) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 1.424s
[INFO] 
[INFO] --- impsort:1.12.0:sort (sort-imports) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 0.637s
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Copying 6 resources from src/main/resources to target/classes
[INFO] 
[INFO] --- quarkus:999-SNAPSHOT:track-config-changes (track-config-changes) @ quarkus-integration-test-oidc-wiremock ---
[INFO] 
[INFO] --- quarkus:999-SNAPSHOT:generate-code (default) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 1.872s
[INFO] 
[INFO] --- compiler:3.13.0:compile (default-compile) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 1.379s
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Copying 6 resources from src/test/resources to target/test-classes
[INFO] 
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 1.717s
[INFO] 
[INFO] --- surefire:3.5.0:test (default-test) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 39.089s
[INFO] 
[INFO] --- quarkus:999-SNAPSHOT:build (default) @ quarkus-integration-test-oidc-wiremock ---
[INFO] [quarkus-build-caching-extension] Quarkus previous configuration not found
[INFO] [quarkus-build-caching-extension] Quarkus build goal marked as not cacheable
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 2142ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

I've run mvn clean first, then I changed the test source just to get it recompiled, the tests do not run

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

sberyozkin commented 1 month ago
surefire:3.5.0:test (default-test) @ quarkus-integration-test-oidc-wiremock ---
[INFO] Loaded from the build cache, saving 39.089s

Seems to be a problem

gsmet commented 1 month ago

It's actually a feature not a problem :). That's the whole purpose of the cache: it will only run the tests if you made some changes. Now, it's indeed annoying when trying to reproduce a flaky test or testing test stability. That's why you can bypass the cache by adding -Dno-build-cache to your Maven command line.

It's documented in this section: https://github.com/quarkusio/quarkus/blob/main/CONTRIBUTING.md#develocity-build-cache .

sberyozkin commented 1 month ago

Thanks for the explanation @gsmet 👍