synapse/tests
Richard van der Hoff 31b554c297
Fixes for opentracing scopes (#11869)
`start_active_span` was inconsistent as to whether it would activate the span
immediately, or wait for `scope.__enter__` to happen (it depended on whether
the current logcontext already had an associated scope). The inconsistency was
rather confusing if you were hoping to set up a couple of separate spans before
activating either.

Looking at the other implementations of opentracing `ScopeManager`s, the
intention is that it *should* be activated immediately, as the name
implies. Indeed, the idea is that you don't have to use the scope as a
contextmanager at all - you can just call `.close` on the result. Hence, our
cleanup has to happen in `.close` rather than `.__exit__`.

So, the main change here is to ensure that `start_active_span` does activate
the span, and that `scope.close()` does close the scope.

We also add some tests, which requires a `tracer` param so that we don't have
to rely on the global variable in unit tests.
2022-02-02 22:41:57 +00:00
..
api
app
appservice Convert ApplicationServiceTestCase to use simple_async_mock (#11880) 2022-02-01 17:45:13 +00:00
config
crypto
events
federation
handlers Add a background database update to purge account data for deactivated users. (#11655) 2022-02-02 11:37:18 +00:00
http Add a regression test for using both webclient and client resources simultaneously (#11765) 2022-01-20 09:47:29 -05:00
logging Fixes for opentracing scopes (#11869) 2022-02-02 22:41:57 +00:00
module_api
push
replication Make the get_global_account_data_by_type_for_user cache be a tree-cache whose key is prefixed with the user ID (#11788) 2022-01-21 08:38:36 +00:00
rest Expose the registered device ID from the register_appservice_user test helper. (#11615) 2022-02-02 09:59:55 +00:00
scripts
server_notices
state
storage Expose the registered device ID from the register_appservice_user test helper. (#11615) 2022-02-02 09:59:55 +00:00
test_utils
util
__init__.py
server.py Support rendering previews with data: URLs in them (#11767) 2022-01-24 08:58:18 -05:00
test_distributor.py
test_event_auth.py
test_federation.py
test_mau.py
test_metrics.py
test_phone_home.py
test_server.py
test_state.py
test_terms_auth.py
test_test_utils.py
test_types.py
test_visibility.py
unittest.py Expose the registered device ID from the register_appservice_user test helper. (#11615) 2022-02-02 09:59:55 +00:00
utils.py