3 # Copyright (C) 2024 Kienan Stewart <kstewart@efficios.com>
4 # SPDX-License-Identifier: GPL-2.0-only
8 Test for https://review.lttng.org/c/lttng-tools/+/11819
10 A live client shouldn't hang around after a session with no data has
19 # Import in-tree test utils
20 test_utils_import_path
= pathlib
.Path(__file__
).absolute().parents
[3] / "utils"
21 sys
.path
.append(str(test_utils_import_path
))
26 tap
= lttngtest
.TapGenerator(1)
29 def test_live_hang(tap
, test_env
):
30 client
= lttngtest
.LTTngClient(test_env
, log
=tap
.diagnostic
)
33 output
= lttngtest
.NetworkSessionOutputLocation(
34 "net://localhost:{}:{}/".format(
35 test_env
.lttng_relayd_control_port
, test_env
.lttng_relayd_data_port
38 session
= client
.create_session(output
=output
, live
=True)
40 # lttng enable-event --userspace --all
41 channel
= session
.add_channel(lttngtest
.lttngctl
.TracingDomain
.User
)
42 channel
.add_recording_rule(lttngtest
.lttngctl
.UserTracepointEventRule())
45 test_app
= test_env
.launch_wait_trace_test_application(100)
49 viewer
= test_env
.launch_live_viewer(session
.name
)
50 viewer
.wait_until_connected()
57 "BT2 live viewer exited successfully",
61 with lttngtest
.test_environment(
62 with_sessiond
=True, log
=tap
.diagnostic
, with_relayd
=True
64 test_live_hang(tap
, test_env
)
66 sys
.exit(0 if tap
.is_successful
else 1)