-
Notifications
You must be signed in to change notification settings - Fork 690
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add tests for python worker deadlocks
- Loading branch information
1 parent
e24fef1
commit eafb025
Showing
10 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def application(env, start_response): | ||
start_response("200 OK", [("Content-Type", "text/plain")]) | ||
message = "Hello World" | ||
return [message.encode("utf-8")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[uwsgi] | ||
show-config = true | ||
master = true | ||
enable-threads = false | ||
workers = 1 |
6 changes: 6 additions & 0 deletions
6
tests/deadlocks/master-singleinterpreter-threads-10workers.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[uwsgi] | ||
show-config = true | ||
master = true | ||
enable-threads = true | ||
workers = 10 | ||
single-interpreter = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[uwsgi] | ||
show-config = true | ||
master = true | ||
enable-threads = true | ||
workers = 1 | ||
single-interpreter = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[uwsgi] | ||
show-config = true | ||
master = true | ||
enable-threads = true | ||
workers = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[uwsgi] | ||
show-config = true | ||
master = true | ||
enable-threads = true | ||
workers = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[uwsgi] | ||
show-config = true | ||
master = false | ||
enable-threads = true | ||
workers = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[uwsgi] | ||
show-config = true | ||
master = false | ||
enable-threads = true | ||
workers = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import threading | ||
import time | ||
|
||
|
||
def run(): | ||
print("[DEADLOCKS] started run") | ||
st = time.time() | ||
while time.time() < st + 5: | ||
pass | ||
print("[DEADLOCKS] finished run") | ||
|
||
t = threading.Thread(target=run) | ||
t.daemon = True | ||
t.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters