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
While using the example unit tests from the dev-doc, ran into some problems that might find a way to get updated in another PR. The following was not addressed in #3398 because it's not entirely clear how it should work, i.e. the working code with comments on failures is like:
# import all the dask distributed pytest fixturesfromdistributedimportFuturefromdistributed.utils_testimport*# pylint: disable=wildcard-importdeftest_sync_submit(client):
future=client.submit(inc, 10)
assertisinstance(future, Future)
assertfuture.result() ==11# use the synchronous/blocking API heredeftest_sync_submit_full(client, s, a, b):
""" In this style of test you do not have access to the scheduler or workers. The variables s, a, b are now dictionaries holding a multiprocessing.Process object and a port integer. However, you can now use the normal synchronous API (never use yield in this style of test) and you can close processes easily by terminating them. """assertisinstance(client, Client)
assertisinstance(s, dict)
assertclient.scheduler.address==s['address']
assertisinstance(a, dict) # worker-aassertisinstance(b, dict) # worker-bfuture=client.submit(inc, 10)
assertisinstance(future, Future)
assertfuture.result() ==11# use the synchronous/blocking API herefixed_test=Falseiffixed_test:
# killing a worker fails the test cleanup checks:# Failed: some RPCs left active by testworker_process=a['proc']() # call weakref to get worker processworker_process.terminate() # kill one of the workers# client.retire_workers() # also not a clean test teardownresult=future.result() # test that future remains validassertisinstance(future, Future)
assertresult==11
The text was updated successfully, but these errors were encountered:
Remaining issue after #3398
While using the example unit tests from the dev-doc, ran into some problems that might find a way to get updated in another PR. The following was not addressed in #3398 because it's not entirely clear how it should work, i.e. the working code with comments on failures is like:
The text was updated successfully, but these errors were encountered: