Try a different way.

This commit is contained in:
Itamar Turner-Trauring 2023-05-04 13:54:04 -04:00
parent bee295e411
commit 3b52457d1c

View File

@ -14,7 +14,7 @@ from __future__ import annotations
import time import time
from urllib.parse import unquote as url_unquote, quote as url_quote from urllib.parse import unquote as url_unquote, quote as url_quote
from twisted.internet.defer import ensureDeferred from twisted.internet.threads import deferToThread
import allmydata.uri import allmydata.uri
from allmydata.util import jsonbytes as json from allmydata.util import jsonbytes as json
@ -253,8 +253,8 @@ def test_status(alice):
assert found_download, "Failed to find the file we downloaded in the status-page" assert found_download, "Failed to find the file we downloaded in the status-page"
@run_in_thread @pytest_twisted.ensureDeferred
def test_directory_deep_check(reactor, request, alice): async def test_directory_deep_check(reactor, request, alice):
""" """
use deep-check and confirm the result pages work use deep-check and confirm the result pages work
""" """
@ -264,9 +264,11 @@ def test_directory_deep_check(reactor, request, alice):
required = 2 required = 2
total = 4 total = 4
result = util.reconfigure(reactor, request, alice, (happy, required, total), convergence=None) await util.reconfigure(reactor, request, alice, (happy, required, total), convergence=None)
pytest_twisted.blockon(ensureDeferred(result)) await deferToThread(_test_directory_deep_check_blocking, alice)
def _test_directory_deep_check_blocking(alice):
# create a directory # create a directory
resp = requests.post( resp = requests.post(
util.node_url(alice.node_dir, u"uri"), util.node_url(alice.node_dir, u"uri"),