Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications/Testing of TimeoutStrategy #21

Merged
merged 28 commits into from
Mar 4, 2024

Conversation

derekpierre
Copy link
Member

@derekpierre derekpierre commented Mar 1, 2024

Related to #15 .

Add tests and makes some fixes for TimeoutStrategy.

Based over #17 .

…ling the different types of txs appropriately.
…e in providing a callback to alert the user about pausing.

Move queue_transaction to _Machine instead - more applicable there since internals of _Machine are used.
Move exposed functions to their own section in _Machine.
…any processing for this execution round of the machine; reasses during next execution round.
Pause will cause the looping task to stop (sleep), and resume will cause the looping task to start (wake).
Idle state itself does not need processing, just setting of the interval when it is transitioned into.
… a tx got queued, OR we are in pause and need to be woken up.
…ove to the PAUSED state instead of waiting until next iteration of looping call.
…a specialized case of it.

TransactionFault -> TransactionFaulted
…aultedTx from that; simpler than taking values from exception the passing it along etc.

Also ensures that faulted tx is indeed the same as the active tx as an added bit of validation.
Raise RuntimeError if a None pending tx is provided.
Rename TimeoutPause to TimeoutStrategy.
@derekpierre derekpierre self-assigned this Mar 1, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.30640% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 86.49%. Comparing base (b29c763) to head (dc44376).
Report is 1 commits behind head on main.

Files Patch % Lines
atxm/machine.py 93.18% 3 Missing ⚠️
atxm/tracker.py 83.33% 2 Missing ⚠️
atxm/strategies.py 94.11% 1 Missing ⚠️
atxm/utils.py 80.00% 1 Missing ⚠️
tests/test_machine.py 99.20% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
+ Coverage   81.30%   86.49%   +5.19%     
==========================================
  Files          13       14       +1     
  Lines         920     1074     +154     
==========================================
+ Hits          748      929     +181     
+ Misses        172      145      -27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@derekpierre derekpierre changed the title [WIP] Testing of TimeoutStrategy Testing of TimeoutStrategy Mar 1, 2024
@derekpierre derekpierre marked this pull request as ready for review March 1, 2024 18:06
@derekpierre derekpierre changed the title Testing of TimeoutStrategy Modifications/Testing of TimeoutStrategy Mar 4, 2024
@KPrasch KPrasch merged commit 6248d7d into nucypher:main Mar 4, 2024
4 checks 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.

3 participants