Changeset f12b78e in trunk


Ignore:
Timestamp:
2023-03-21T13:43:45Z (2 years ago)
Author:
GitHub <noreply@…>
Branches:
master
Children:
559e2ec, a8832b1, d96a22e
Parents:
2dfabf79 (diff), 23b977a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Itamar Turner-Trauring <itamar@…> (2023-03-21 13:43:45)
git-committer:
GitHub <noreply@…> (2023-03-21 13:43:45)
Message:

Merge pull request #1271 from tahoe-lafs/3988-failing-test-http

Fix failing integration test

Fixes ticket:3988

Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified integration/conftest.py

    r2dfabf79 rf12b78e  
    394394        )
    395395    )
    396     await_client_ready(process)
     396    pytest_twisted.blockon(await_client_ready(process))
    397397
    398398    # 1. Create a new RW directory cap:
     
    425425    # 4. Restart the node with new SFTP config.
    426426    pytest_twisted.blockon(process.restart_async(reactor, request))
    427     await_client_ready(process)
     427    pytest_twisted.blockon(await_client_ready(process))
    428428    print(f"Alice pid: {process.transport.pid}")
    429429    return process
     
    440440        )
    441441    )
    442     await_client_ready(process)
     442    pytest_twisted.blockon(await_client_ready(process))
    443443    return process
    444444
  • TabularUnified integration/test_get_put.py

    r2dfabf79 rf12b78e  
    55
    66from subprocess import Popen, PIPE, check_output, check_call
    7 import sys
    87
    98import pytest
     
    5150
    5251
     52@run_in_thread
    5353def test_get_to_stdout(alice, get_put_alias, tmpdir):
    5454    """
     
    6868
    6969
     70@run_in_thread
    7071def test_large_file(alice, get_put_alias, tmp_path):
    7172    """
     
    8687
    8788
    88 @pytest.mark.skipif(
    89     sys.platform.startswith("win"),
    90     reason="reconfigure() has issues on Windows"
    91 )
    9289@ensureDeferred
    9390async def test_upload_download_immutable_different_default_max_segment_size(alice, get_put_alias, tmpdir, request):
  • TabularUnified integration/test_servers_of_happiness.py

    r2dfabf79 rf12b78e  
    3232        total=10,
    3333    )
    34     util.await_client_ready(edna)
     34    yield util.await_client_ready(edna)
    3535
    3636    node_dir = join(temp_dir, 'edna')
  • TabularUnified integration/test_tor.py

    r2dfabf79 rf12b78e  
    4343    carol = yield _create_anonymous_node(reactor, 'carol', 8008, request, temp_dir, flog_gatherer, tor_network, tor_introducer_furl)
    4444    dave = yield _create_anonymous_node(reactor, 'dave', 8009, request, temp_dir, flog_gatherer, tor_network, tor_introducer_furl)
    45     util.await_client_ready(carol, minimum_number_of_servers=2)
    46     util.await_client_ready(dave, minimum_number_of_servers=2)
     45    yield util.await_client_ready(carol, minimum_number_of_servers=2)
     46    yield util.await_client_ready(dave, minimum_number_of_servers=2)
    4747
    4848    # ensure both nodes are connected to "a grid" by uploading
  • TabularUnified integration/test_web.py

    r2dfabf79 rf12b78e  
    1919
    2020from . import util
     21from .util import run_in_thread
    2122
    2223import requests
     
    2627from pytest_twisted import ensureDeferred
    2728
     29@run_in_thread
    2830def test_index(alice):
    2931    """
     
    3335
    3436
     37@run_in_thread
    3538def test_index_json(alice):
    3639    """
     
    4245
    4346
     47@run_in_thread
    4448def test_upload_download(alice):
    4549    """
     
    7175
    7276
     77@run_in_thread
    7378def test_put(alice):
    7479    """
     
    9095
    9196
     97@run_in_thread
    9298def test_helper_status(storage_nodes):
    9399    """
     
    102108
    103109
     110@run_in_thread
    104111def test_deep_stats(alice):
    105112    """
     
    418425
    419426
     427@run_in_thread
    420428def test_storage_info(storage_nodes):
    421429    """
     
    429437
    430438
     439@run_in_thread
    431440def test_storage_info_json(storage_nodes):
    432441    """
     
    443452
    444453
     454@run_in_thread
    445455def test_introducer_info(introducer):
    446456    """
     
    461471
    462472
     473@run_in_thread
    463474def test_mkdir_with_children(alice):
    464475    """
  • TabularUnified integration/util.py

    r2dfabf79 rf12b78e  
    431431
    432432
     433def run_in_thread(f):
     434    """Decorator for integration tests that runs code in a thread.
     435
     436    Because we're using pytest_twisted, tests that rely on the reactor are
     437    expected to return a Deferred and use async APIs so the reactor can run.
     438
     439    In the case of the integration test suite, it launches nodes in the
     440    background using Twisted APIs.  The nodes stdout and stderr is read via
     441    Twisted code.  If the reactor doesn't run, reads don't happen, and
     442    eventually the buffers fill up, and the nodes block when they try to flush
     443    logs.
     444
     445    We can switch to Twisted APIs (treq instead of requests etc.), but
     446    sometimes it's easier or expedient to just have a blocking test.  So this
     447    decorator allows you to run the test in a thread, and the reactor can keep
     448    running in the main thread.
     449
     450    See https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3597 for tracking bug.
     451    """
     452    @wraps(f)
     453    def test(*args, **kwargs):
     454        return deferToThread(lambda: f(*args, **kwargs))
     455    return test
     456
     457
    433458def await_file_contents(path, contents, timeout=15, error_if=None):
    434459    """
     
    556581
    557582
     583@run_in_thread
    558584def await_client_ready(tahoe, timeout=10, liveness=60*2, minimum_number_of_servers=1):
    559585    """
     
    623649
    624650
    625 def run_in_thread(f):
    626     """Decorator for integration tests that runs code in a thread.
    627 
    628     Because we're using pytest_twisted, tests that rely on the reactor are
    629     expected to return a Deferred and use async APIs so the reactor can run.
    630 
    631     In the case of the integration test suite, it launches nodes in the
    632     background using Twisted APIs.  The nodes stdout and stderr is read via
    633     Twisted code.  If the reactor doesn't run, reads don't happen, and
    634     eventually the buffers fill up, and the nodes block when they try to flush
    635     logs.
    636 
    637     We can switch to Twisted APIs (treq instead of requests etc.), but
    638     sometimes it's easier or expedient to just have a blocking test.  So this
    639     decorator allows you to run the test in a thread, and the reactor can keep
    640     running in the main thread.
    641 
    642     See https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3597 for tracking bug.
    643     """
    644     @wraps(f)
    645     def test(*args, **kwargs):
    646         return deferToThread(lambda: f(*args, **kwargs))
    647     return test
    648 
    649651@frozen
    650652class CHK:
     
    793795
    794796    if changed:
    795         # TODO reconfigure() seems to have issues on Windows. If you need to
    796         # use it there, delete this assert and try to figure out what's going
    797         # on...
    798         assert not sys.platform.startswith("win")
    799 
    800797        # restart the node
    801798        print(f"Restarting {node.node_dir} for ZFEC reconfiguration")
    802799        await node.restart_async(reactor, request)
    803800        print("Restarted.  Waiting for ready state.")
    804         await_client_ready(node)
     801        await await_client_ready(node)
    805802        print("Ready.")
    806803    else:
Note: See TracChangeset for help on using the changeset viewer.