Skip to content

Commit 65f3c81

Browse files
logging tracebacks in verbose mode
1 parent b3c6948 commit 65f3c81

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

contentctl/actions/detection_testing/DetectionTestingManager.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import List,Union
2+
import traceback
23
from contentctl.objects.config import test, test_servers, Container,Infrastructure
34
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructure import DetectionTestingInfrastructure
45
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructureContainer import DetectionTestingInfrastructureContainer
@@ -98,6 +99,10 @@ def sigint_handler(signum, frame):
9899
_ = future.result()
99100
except Exception as e:
100101
self.output_dto.terminate = True
102+
# Output the traceback if we encounter errors in verbose mode
103+
if self.input_dto.config.verbose:
104+
tb = traceback.format_exc()
105+
print(tb)
101106
errors["INSTANCE SETUP ERRORS"].append(e)
102107

103108
# Start and wait for all tests to run
@@ -113,6 +118,10 @@ def sigint_handler(signum, frame):
113118
_ = future.result()
114119
except Exception as e:
115120
self.output_dto.terminate = True
121+
# Output the traceback if we encounter errors in verbose mode
122+
if self.input_dto.config.verbose:
123+
tb = traceback.format_exc()
124+
print(tb)
116125
errors["TESTING ERRORS"].append(e)
117126

118127
self.output_dto.terminate = True
@@ -125,13 +134,21 @@ def sigint_handler(signum, frame):
125134
try:
126135
_ = future.result()
127136
except Exception as e:
137+
# Output the traceback if we encounter errors in verbose mode
138+
if self.input_dto.config.verbose:
139+
tb = traceback.format_exc()
140+
print(tb)
128141
errors["ERRORS DURING VIEW SHUTDOWN"].append(e)
129142

130143
# Wait for original view-related threads to complete
131144
for future in concurrent.futures.as_completed(future_views):
132145
try:
133146
_ = future.result()
134147
except Exception as e:
148+
# Output the traceback if we encounter errors in verbose mode
149+
if self.input_dto.config.verbose:
150+
tb = traceback.format_exc()
151+
print(tb)
135152
errors["ERRORS DURING VIEW EXECUTION"].append(e)
136153

137154
# Log any errors

0 commit comments

Comments
 (0)