Repository navigation
Conversation
Store sequence counter state on each DataDrivenMockFactory for the
lifetime of its registry registration so repeated resolve() calls from
create_mockable_tool_wrapper advance {{sequence('X')}} instead of
restarting at 001.
Fixes intuit#81
|
Thanks for tackling this! The wrapper regression tests are useful, but the counter needs to be scoped to a run rather than the lifetime of the registered factory. With one registry and two concurrent invocations using different thread_ids, I reproduced:
The change to test_each_run_starts_fresh also masks a regression: it now creates a separate factory instead of checking that a fresh run on the same factory starts at 001. Please preserve the original direct-call reset test, add a wrapper test with one shared registry and two different thread_ids, and scope the counters to the run/episode with appropriate concurrency and lifecycle handling. The current tests pass, but they don’t cover isolation between runs. |
f4db0d5 to
ff414c0
Compare
…gfix/81-sequence-counter-persist
Restore direct-call coverage for separate thread_ids on one DataDrivenMockFactory, add resolve-style rebinding and reset_sequences tests. Co-authored-by: Joel Shearon <hippi345@users.noreply.github.com>
|
Thanks for catching this. Factory-lifetime counters let interleaved thread_ids bleed into each other. Sequence state is now keyed per run on the registered DataDrivenMockFactory (configurable.thread_id + checkpoint_ns, falling back to run_id), with a lock for concurrent runs on one registry, and reset_sequences() clears one run or all of them. test_each_run_starts_fresh now uses two thread_ids on the same factory, so it actually proves run isolation, and new tests cover concurrent runs on a shared registry and counters persisting across resolve() rebinding. Tracked runs are LRU-capped at 1024 keys; let me know if you'd rather have explicit teardown when a thread completes. |
|
@hippi345 could you please update this branch with the latest Please preserve its seeded RNG and fixed-clock changes, and align sequence counters with the stable Please rerun the tests after resolving the conflict, including a real multi-step graph test confirming |
Store sequence counter state on each DataDrivenMockFactory for the lifetime of its registry registration so repeated resolve() calls from create_mockable_tool_wrapper advance {{sequence('X')}} instead of restarting at 001.
Fixes #81
Checklist
🚨 Please review this repository's contribution guidelines.
[Unreleased]changelog entry for a user-visible change, or confirmed the change is exempt.Description
What does this change do and why?
Fixes #(issue number)
Thank you!