Skip to content

Fix random test failures caused by mainnet connections #722

@tegefaulkes

Description

@tegefaulkes

Specification

While working on #720 I was re-enabling disabled tests. One of them can pull a cloned vault at tests/vaults/VaultManager.test.ts:932 was failing intermittently. After some digging I found that it was caused by external connections and RPC requests being made to the test NodeConnectionManager being used within the test.

image

There are two problems with this.

  1. NodeConnectionManagers within tests should not be starting or receiving any connections during the test. This is just to maintain test isolation since test failures should ideally be directly related to what the test is checking. This would depend on Allow NodeManager to start lazily without network entry procedure #461 being completed and then updating all relevant tests.
  2. The error causing the test to fail is an RPC error for missing a handler. This shouldn't be causing the test to fail since this error should only be thrown back through the RPC call being made. I'll have to find out why it's causing the test to fail since it's very likely a bug. Unless there's some weird interaction where our test NodeConnectionManager is attempting the RPC call to a RPCServer that doesn't have the handler? Needs more digging.

Additional context

Tasks

  1. Ensure all tests PolykeyAgents and NodeConnectionManagers don't attempt to interact with the wider mainnet while testing by starting with network entry disabled.
  2. Dig into why the RPC error is causing the test to fail and fix any bug that may be revealed.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions