Skip to content

Use Released Node as Peer During Integration Tests #271

Open

Description

@rotilho

Currently, during integration tests, we spin up peers using the same codebase being tested. This is essential to fully verify node intercommunication and simulate production-like environments.
To achieve this, we create a custom class loader and manipulate ports to ensure peers can run without conflicts.

While this method provides a good level of isolation, it comes with two major drawbacks:

  1. Self-validation problem: We are testing the current implementation against itself. In production, the network will consist of a heterogeneous mix of node versions. Our current setup risks missing incompatibilities between the new implementation and released nodes.
  2. Performance issues: Spinning up multiple peers this way is very slow. The current released node is heavily optimized and can start in around 1 second.

Proposal

The integration tests will be modified to no longer create peers by spinning up a custom classloader. Instead, we will use Testcontainers to dynamically pull and run the latest released live container as the peers during test execution.
This will allow us to test the current implementation against a real, production-ready node, ensuring a much higher degree of realism and interoperability.

Activity

  1. added theissue type on Apr 28, 2025
  2. removed theissue type on Apr 28, 2025
  3. Cryptoloveer commented on Sep 12, 2026

    @Cryptoloveer

    I reviewed the current Cucumber harness. Peer nodes are started with isolated class loaders, share the test MySQL instance, receive a generated signer/genesis through command-line properties, and are later queried through objects stored in PropertyHolder. Moving them to ghcr.io/attocash/node containers is feasible, but a few acceptance choices affect the implementation:

    1. Should tests pin the latest GitHub release tag, use latest, or receive an image tag through a Gradle property?
    2. Should every neighbour step start a separate container, or should scenarios reuse a released-node container?
    3. Is Docker availability mandatory for the full test task, or should these scenarios skip with a clear message when Docker is unavailable?

    Once those are confirmed, I can keep the change focused on the test harness and preserve the existing Cucumber steps.

  4. rotilho commented on Sep 12, 2026

    @rotilho
    ContributorAuthor

    Thanks for taking a look at this and for the questions!

    1. It should use the :live tag. By default, the integration tests should continue using the classpath nodes as they do today. In the CI pipeline, however, I’d like to run two test suites in parallel: one using the current classpath-based setup, and another using the Testcontainers node pointing to :live.
    2. It should always use a fresh :live image.
    3. Yes. A container runtime is already required for running the integration tests because MySQL is already provided through Testcontainers, so this shouldn’t introduce a new runtime dependency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions