You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I am looking for a mechanism to repeatedly put a specific test into a worker queue if the item hits a specific kind of exception (checkpoint).
It would be pretty much similar to the already-existing hook: pytest_handlecrashitem(crashitem, report, sched),
However, it could act on a "failed" test event.
My idea was to define a custom exception, called checkpoint, that I'd raise from the test/fixture, to indicate, that I want the scheduler to put the test into "background" and come back to it later, so the worker can be unblocked to run fixtures for other tests.
This way, together with a use of some external resource, i could achieve syncing of the test case setups, before running some action that requires all fixtures of all test cases to be already executed.
our use case is a common server fixture, that all the tests share due to resource savings.
This server needs to be upgraded as a part of another fixture, so we want to ensure, fixtures of all the tests have ran on this server before we can perform the upgrade.
Alternatively - is there a way of artificially "crashing" the node from the item/session context so I can invoke pytest_testnodedown and consequently pytest_handlecrashitem hooks? That would be a hacky approach, but could work for me.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi!
I am looking for a mechanism to repeatedly put a specific test into a worker queue if the item hits a specific kind of exception (checkpoint).
It would be pretty much similar to the already-existing hook:
pytest_handlecrashitem(crashitem, report, sched)
,However, it could act on a "failed" test event.
My idea was to define a custom exception, called
checkpoint
, that I'd raise from the test/fixture, to indicate, that I want the scheduler to put the test into "background" and come back to it later, so the worker can be unblocked to run fixtures for other tests.This way, together with a use of some external resource, i could achieve syncing of the test case setups, before running some action that requires all fixtures of all test cases to be already executed.
our use case is a common server fixture, that all the tests share due to resource savings.
This server needs to be upgraded as a part of another fixture, so we want to ensure, fixtures of all the tests have ran on this server before we can perform the upgrade.
Alternatively - is there a way of artificially "crashing" the node from the item/session context so I can invoke
pytest_testnodedown
and consequentlypytest_handlecrashitem
hooks? That would be a hacky approach, but could work for me.Beta Was this translation helpful? Give feedback.
All reactions