[
https://issues.apache.org/jira/browse/GEODE-8728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17388876#comment-17388876
]
ASF subversion and git services commented on GEODE-8728:
--------------------------------------------------------
Commit cb2f9874ca9e8840afaff932e1ef53b93552d967 in geode's branch
refs/heads/develop from Dale Emery
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=cb2f987 ]
GEODE-8728: Isolate tests without Docker (#6720)
* GEODE-8728: Isolate tests without Docker
This commit changes Geode's build system to run test worker processes
outside of Docker. It replaces the Dockerized test plugin with a new
plugin that assigns each test worker process a distinct range of ports.
BUILD SYSTEM
Changed `multi-process-test.gradle` to mark relevant test tasks as
isolated tests. The `IsolatedTestPlugin` applies itself to test tasks
marked this way.
DOCKERIZED TEST PLUGIN
Removed the dockerized test plugin.
SPECIFY PORT RANGES VIA SYSTEM PROPERTIES
Added `AvailablePort.lowerBound` and `AvailablePort.upperBound` system
properties to specify the range of non-membership ports considered by
the "get random port" methods of `AvaiablePort` and
`AvailablePortHelper`.
Changed `AvailablePort` and `AvailablePortHelper` to use the membership
port range specified by Geode's existing `membership-port-range` system
property, if defined.
Changed `ProcessManager`to forward the test worker JVM's port range
system properties to each child VM it creates.
ISOLATED TEST PLUGIN
Added the `IsolatedTestPlugin`, which overrides Gradle's built-in test
worker process launcher with a custom mechanism:
- `PortRange`: Defines a range of ports.
- `PortRangeContext`: Defines the membership and non-membership port
ranges for a process. Configures each `ProcessBuilder` to set the port
range system properties for the process being launched.
- `CompletableProcess`: Wraps a regular Java `Process` to execute an
action on termination.
- `PortRangeProcessLauncher`: Assigns each test worker process a
distinct port range context. Launches test worker processes. Wraps
each test worker `Process` in a `CompletableProcess` that releases its
port range context when the process terminates.
SPECIFIC TESTS
Changed several tests in `DistributedSystemDUnitTest` and
`InternalDistributedSystemJUnitTest` to clear the port range system
properties added by the `IsolatedTestPlugin`. These tests verify that
the system applies Geode's default port ranges. For these tests to work,
those system properties must not be defined.
Disabled a `NetstatDUnitTest` test that executes `lsof`. When this test
runs CI outside of a Docker container, in the presence of dozens of
tests and potentially hundreds of Geode members, the output of `lsof` is
enormous. The `NetstatFunction` attempts to collect all of the output in
memory, which results in an out of memory exception.
Co-authored-by: Dale Emery <[email protected]>
* Spotless
Co-authored-by: Dale Emery <[email protected]>
> Configure Gradle to run parallel tests in isolation without Docker [PERMANENT]
> ------------------------------------------------------------------------------
>
> Key: GEODE-8728
> URL: https://issues.apache.org/jira/browse/GEODE-8728
> Project: Geode
> Issue Type: Test
> Components: tests
> Affects Versions: 1.14.0
> Reporter: Dale Emery
> Assignee: Dale Emery
> Priority: Major
> Labels: GeodeOperationAPI, pull-request-available
>
> For tests to behave well when run in parallel, each must refrain from using
> ports and test files that are in use by other tests.
> Geode's Gradle build isolates concurrently executing tests by running each
> test class in a Docker container. To do this, the build applies an open
> source "Gradle Dockerized Test" plugin that is obsolete and appears to be
> unmaintained.
> This ticket removes the obsolete plugin and replaces it with a small amount
> of custom Gradle code and a few minor changes to Geode:
> - Configure Gradle to assign each concurrently executing test JVM a unique
> working directory and a distinct range of ports.
> - Change Geode's "available port" feature to allocate ports only from the
> ranges assigned by Gradle.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)