Skip to content

Create a testing framework that generates random test cases #320

@yacovm

Description

@yacovm

We need a test framework that creates random tests and simulates scenarios where nodes either crash or go offline and recover, while transactions are being sent to the nodes.

For that, we need a simple and trivial memory pool that we can inject fake transactions into.
Injecting a transaction into the memory pool will be done by adding a transaction to the memory pool of each instance.
Once a block is indexed in storage, the memory pool is cleaned from the transactions in the block.

For a max round window $m$, we can define a random length for a test - $l=m\cdot k$ for some $k>1$. This will be the length of the number of blocks that need to be finalized.

The test will have a random number of nodes - $3<n<10$ and will do two things in parallel:

  1. Inject transactions in a slow and controlled manner until $l$ blocks are finalized.
  2. Divide the time to intervals of $T$ seconds (1-2 seconds), and will randomly crash or disconnect up to $f$ nodes in an interval.

The first stage of each test will be generating a scenario descriptor, in some human readable format (e.g a JSON array) and then feeding it into a driver module that will orchestrate the nodes and network according to the descriptor.

The test will log what it is doing at each time interval, as well as the status of all nodes.

The motivation is that by creating random test scenarios, we might uncover edge cases and will then later be able to re-run them by taking the descriptor and feeding it into the test driver module.

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