r/Protos • • 2d ago

A Maven cache hit can still fail before JUnit runs: what we learned building Protos on GraalVM

While developing Protos, a programming language built on GraalVM and Truffle, we encountered an interesting CI reliability problem.

GitHub Actions reported an exact Maven dependency cache hit, yet Java tests sometimes failed before executing a single test.

The reason? Maven Surefire dynamically resolves its JUnit Platform provider when tests actually run. Compiling tests and packaging with tests skipped wasn't enough to prepare the complete dependency cache.

Our solution:

  • Resolve the actual provider through an existing lightweight test.
  • Verify dependency availability offline before saving the cache.
  • Run prepared Java test shards offline after an exact cache hit.
  • Enforce the new contract through regression checks.

All local tests pass, and remote CI acceptance is underway. No dependency upgrades, skipped validation gates or changes to the language runtime were required.

This may be relevant to developers working with Maven, JUnit, GraalVM, GraalPy, TruffleRuby, or other JVM-based language implementations.

How do you ensure that your CI dependency cache is actually complete?

Project: https://github.com/guillermomolina/protos

1 Upvotes

0 comments sorted by