Skip to content

feat(test): plugin-based test harness CLI with docs guide and bilingu… - #101

Merged
Yiming1997 merged 5 commits into
Yiming1997:mainfrom
Bury-Lee:feature-test-plugin
Sep 10, 2026
Merged

Yiming1997 merged 5 commits into
Yiming1997:mainfrom
Bury-Lee:feature-test-plugin

Conversation

@Bury-Lee

@Bury-Lee Bury-Lee commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

…al README

…st report

Split test/ into a nested module (replace => ../) so the harness always builds against the local library, never the network copy.

Add eight h* hook-stability plugins (hcount/hpanic/horder/hctx/hblock/hchurn/hreenter/hclose) on shared machinery in hookcheck.go. Each scenario builds private pools and asserts PASS/FAIL invariants within the registration contract (hooks are added before dispatch and frozen once tasks run): exact event accounting, panic immunity at callback and dispatch level, per-task event order and ctx payload fidelity, cancellation semantics, slow/reentrant hooks, concurrent registration bursts and OnPoolClosed exactly-once.

Add run_hook_stress.bat/.sh (optional race arg) and update docs/test-harness.md plus both test READMEs. Report: docs/hook-stability-test-report.md
- Hook callbacks now receive only ctx; per-task data travels via SubmitCtx.

- Enqueued is dispatched exactly once per accepted task, after the overflow-buffer lock is released, so a slow or reentrant callback can no longer stall buffer access or self-deadlock on taskMu.

- test: add henqueue (overflow accounting + reentrant watchdog), sandwich the panicking callback between two counter sets in hpanic, and keep running every scenario after a failure.
Move internal/hook to the importable hook package and export the agilepool.Hooks interface accepted by Pool.SetHook, so third-party modules can use the bundled dispatcher. Update the gin example and the test harness to the public import, document lifecycle hooks in both READMEs, and drop the internal/hook package.
test/go.mod required go 1.26.4, so the nested module failed to compile on Go 1.23.4 (the root module's minimum and the version CI installs): 'go.mod requires go >= 1.26.4'. Align the directive with the library and refresh the stale comment (the harness uses the public hook package now). Verified: root, test and example modules build and vet on both Go 1.23.4 and the default toolchain.
@Yiming1997
Yiming1997 merged commit 40366f5 into Yiming1997:main Sep 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants