Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pulsar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NDIP
Pulsar
Commits
651dd06b
Commit
651dd06b
authored
9 years ago
by
John Chilton
Browse files
Options
Downloads
Patches
Plain Diff
Add thread debugging function to test_utils.
(In case I need it in the future again.)
parent
0be430fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_utils.py
+18
-0
18 additions, 0 deletions
test/test_utils.py
with
18 additions
and
0 deletions
test/test_utils.py
+
18
−
0
View file @
651dd06b
from
__future__
import
print_function
import
traceback
import
sys
import
threading
from
contextlib
import
contextmanager
from
stat
import
S_IXOTH
from
os
import
pardir
,
stat
,
chmod
,
access
,
X_OK
,
pathsep
,
environ
...
...
@@ -408,3 +414,15 @@ def files_server(directory=None):
app
=
TestApp
(
JobFilesApp
(
directory
))
with
server_for_test_app
(
app
)
as
server
:
yield
server
def
dump_other_threads
():
# Utility for debugging threads that aren't dying during
# tests.
main_thread
=
threading
.
current_thread
()
for
t
in
threading
.
enumerate
():
if
t
is
main_thread
:
continue
print
(
t
.
getName
())
traceback
.
print_stack
(
sys
.
_current_frames
()[
t
.
ident
])
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment