Skip to content

Add ASIO event simulation for unit testing #184

@SeanTAllen

Description

@SeanTAllen

Fixing #183 (spurious _on_connection_failure() after hard_close()) highlighted a gap in lori's test infrastructure: there's no way to control or simulate ASIO event sequences in unit tests.

The bug in #183 requires a specific event ordering to reproduce: connected → close → hard_close → disposable event → _try_shutdown(). This sequence happens naturally in real usage (reproduced via ponylang/postgres's TerminateSentOnClose test) but can't be triggered from a lori unit test because the ASIO event dispatch is opaque to test code.

Being able to simulate or inject ASIO events (readable, writeable, disposable, with controlled ordering) would make it possible to test edge cases in _event_notify and the shutdown state machine that are currently only exercisable through integration tests in downstream projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs discussionNeeds to be discussed furtherneeds investigationThis needs to be looked into before its "ready for work"

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions