Skip to content

BasicNetworkTestSuite: Split the remaining multi-scenario facts #347

Description

@YYDan

Description

BasicNetworkTestSuite was never covered by the summer 2024 refactor campaign. It holds 13 asserts in 7 tests across 303 lines, six of which are addTestAsync().

Two tests carry three asserts each across 62 lines: network_send_packet_test and network_send_packet_handshake_test.

This suite should be split conservatively. Every async test here opens a socket, performs a handshake and tears the connection down. Splitting one into three means three full connect/handshake cycles instead of one, which both slows the suite and increases the chance of flakiness from the local test server. The asserts within these facts are also largely sequential — the packet must be sent before the response can be checked.

The realistic outcome may be that only one or two asserts are genuinely independent and worth lifting out. That is a legitimate result and should be recorded on the issue rather than forcing a split.

Script Name

BasicNetworkTestSuite

Steps To The Task

  • Audit network_send_packet_test and network_send_packet_handshake_test and identify which asserts are independent of the connection sequence
  • Split only the genuinely independent scenarios, named <original_name> #N
  • Record on the issue which asserts were deliberately left grouped and why
  • Update assert descriptions so they identify the specific scenario
  • Add section comment headers separating connection tests from packet tests
  • Run the suite against the local test server on VM and YYC, and check the suite's wall-clock time has not regressed unacceptably

Metadata

Metadata

Assignees

Labels

refactorAn improvement to existing test/module code

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions