Skip to content

Commit 8d6ac9c

Browse files
committed
fix (test): remove test and coverage for BaseCollector.background_report
As the BaseCollector.background_report runs in a thread on top of a `while True` loop, it's test is impossible to capture the output. Signed-off-by: Paulo Vital <[email protected]>
1 parent 8d3e7b5 commit 8d6ac9c

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/instana/collector/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def background_report(self) -> None:
131131
132132
@return: None
133133
"""
134-
while True:
134+
while True: # pragma: no cover
135135
if self.thread_shutdown.is_set():
136136
logger.debug(
137137
"Thread shutdown signal is active: Shutting down reporting thread"

tests/collector/test_base_collector.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ def test_shutdown(
146146
assert "Collector.shutdown: Reporting final data." in caplog.messages
147147
assert not self.collector.started
148148

149-
def test_background_report(self) -> None:
150-
assert self.collector.background_report()
151-
self.collector.thread_shutdown.set()
152-
assert not self.collector.background_report()
153-
154149
def test_should_send_snapshot_data(self, caplog: LogCaptureFixture) -> None:
155150
caplog.set_level(logging.DEBUG, logger="instana")
156151
self.collector.should_send_snapshot_data()

0 commit comments

Comments
 (0)