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

Add ability to test asynchronous actions. #12

Merged
merged 1 commit into from
Mar 24, 2022
Merged

Add ability to test asynchronous actions. #12

merged 1 commit into from
Mar 24, 2022

Conversation

jemc
Copy link
Contributor

@jemc jemc commented Mar 24, 2022

Resolves #5.

Now, if you need to test that something asynchronous happens,
you can call @ctx.wait_for_action("my action") to let the test
runner know that the test isn't over until the action completes.

After the asynchronous action is finished, you can mark it as such
by calling @ctx.finished_action("my action") to let the test
runner know that the action is complete.

You can add new actions to wait for at any time during a test,
but the names must be unique in order for them to be differentiated.

Once all awaited actions are marked as finished, the asynchronous
test example is done running.

If one or more actions don't get marked as finished in a timely manner,
an informational message will be printed every 5 seconds for all open
actions that are still being awaited.

The whole test suite will time out after 30 seconds.

These time intervals will be able to be configured at runtime
using the constant override mechanism mentioned in this ticket:
savi-lang/savi#161

Resolves #5.

Now, if you need to test that something asynchronous happens,
you can call `@ctx.wait_for_action("my action")` to let the test
runner know that the test isn't over until the action completes.

After the asynchronous action is finished, you can mark it as such
by calling `@ctx.finished_action("my action")` to let the test
runner know that the action is complete.

You can add new actions to wait for at any time during a test,
but the names must be unique in order for them to be differentiated.

Once all awaited actions are marked as finished, the asynchronous
test example is done running.

If one or more actions don't get marked as finished in a timely manner,
an informational message will be printed every 5 seconds for all open
actions that are still being awaited.

If the whole test suite will time out after 30 seconds.

These time intervals will be able to be configured at runtime
using the constant override mechanism mentioned in this ticket:
savi-lang/savi#161
@jemc jemc self-assigned this Mar 24, 2022
@jemc jemc merged commit d24e35c into main Mar 24, 2022
@jemc jemc deleted the add/async-tests branch March 24, 2022 01:59
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.

Add asynchronous test fulfillment to spec package.
1 participant