Skip to content

Java: Several tests do not release clients #5347

@jduo

Description

@jduo

Describe the bug

There are several integration tests that do not properly cleanup client resources. They create a new client via the @MethodSource annotation but don't clean it up.

The ones in question are:

  1. cluster/CommandTests.java
  2. standalone/CommandTests.java
  3. cluster/ClusterBatchTests.java
  4. standalone/BatchTests.java

The fix would be to hold the client returned by @MethodSource in a member that can run in the @afterall method.

Expected Behavior

Clients don't leak

Current Behavior

Clients leak, causing test servers to have high memory loads and open sockets.

Reproduction Steps

Not visible directly, but this is likely causing flakey CI on lower-spec systems.

Possible Solution

In the description

Additional Information/Context

No response

Client version used

n/a

Engine type and version

All versions

OS

Primarily Windows

Language

Java

Language Version

17

Cluster information

No response

Logs

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions