Static fields dont do well in Gradle with configuration cache enabled.
- Use buildParams extension in build scripts
- Keep BuildParams.ci for now for easy serverless migration
- Tweak testing doc
When building our patch for immutable collections we must find a jdk to
use for the build. If runtime java is set, this is clear. But if there
is no runtime java, we intend to fallback to the bundled jdk version.
Yet the runtime version in this case does not itself fallback to the
bundled jdk. This commit changes the immutable collections patch build
to explicitly use the bundled jdk version.
ImmutableCollections uses a seed, set early during JVM startup, which
affects the iteration order of collections. Although we do not want to
rely on the iteration order of Map and Set collections, bugs do
sometimes occur. In order to reproduce those bugs to fix them, it is
important the test seed for Elasticsearch matches the seed used in
ImmutableCollections.
Unfortunately ImmutableCollections is internal to the JDK, and the seed
used is private and final. This commit works around these limitations by
creating a patched version of ImmutableCollections which allows access
to the seed member. ESTestCase is then able to reflectively set the seed
at runtime based on the Elasticsearch seed.
Note that this only affects tests. ImmutableCollections remains is
unchanged for production code.
relates #94946