Skip to content

Add unit tests for Action logic - #13332

Merged
JosiahWI merged 2 commits into
apache:masterfrom
JosiahWI:feat/test-action
Jul 28, 2026
Merged

JosiahWI merged 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.

@JosiahWI
JosiahWI merged commit 04ee11a into apache:master Jul 28, 2026
15 checks passed
@JosiahWI
JosiahWI deleted the feat/test-action branch July 28, 2026 11:06
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jul 29, 2026
* Add unit tests for `Action` logic

Authored with Claude Sonnet and Claude Opus.

(cherry picked from commit 04ee11a)
@github-project-automation github-project-automation Bot moved this from Picked v10.2.0 to For v10.2.0 in ATS v10.2.x Jul 29, 2026
@cmcfarlen cmcfarlen moved this to Picked v10.2.0 in ATS v10.2.x Jul 29, 2026
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, 10.2.0 Jul 29, 2026
@cmcfarlen cmcfarlen moved this from For v10.2.0 to Picked v10.2.0 in ATS v10.2.x Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Picked v10.2.0

Development

Successfully merging this pull request may close these issues.

5 participants