feat(test): plugin-based test harness CLI with docs guide and bilingu… - #101
Merged
Merged
Conversation
…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
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…al README