Skip to content

Add unit tests for Action logic#13332

Open
JosiahWI wants to merge 2 commits into
apache:masterfrom
JosiahWI:feat/test-action
Open

Add unit tests for Action logic#13332
JosiahWI wants to merge 2 commits into
apache:masterfrom
JosiahWI:feat/test-action

Conversation

@JosiahWI

@JosiahWI JosiahWI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

I authored these tests with Claude Sonnet and Claude Opus. They are part of a suite of unit tests I am generating with AI, aimed at the event system. The Action interface doesn't have much logic, so most of what's tested here is pretty simple, but there are a few tests related to cancellation that serve as good documentation/examples of how to use actions appropriately.

Authored with Claude Sonnet and Claude Opus.
@bryancall bryancall requested review from cmcfarlen and masaori335 and removed request for cmcfarlen June 29, 2026 22:26
@bryancall bryancall added this to the 11.0.0 milestone Jun 29, 2026
@masaori335 masaori335 requested a review from Copilot July 8, 2026 05:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Catch2 unit test executable covering the Action contract in the inkevent event system, with emphasis on assignment semantics (continuation/mutex binding) and cancellation behavior (including cancellation of scheduled events).

Changes:

  • Introduces test_Action.cc with unit tests validating Action’s observable state transitions (operator=, cancel, cancel_action) and sentinel encodings (MAKE_ACTION_RESULT, ACTION_RESULT_DONE, ACTION_IO_ERROR).
  • Adds a multithreaded test that schedules and cancels an event before its deadline to verify no dispatch occurs.
  • Wires the new unit test into the inkevent CMake test targets.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/iocore/eventsystem/unit_tests/test_Action.cc New Catch2 tests exercising Action assignment/cancellation behavior and action-result sentinels, plus a scheduled-event cancellation scenario.
src/iocore/eventsystem/CMakeLists.txt Adds test_Action executable and registers it as a Catch2 test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants