Skip to content

Commit 39bea32

Browse files
committed
Add an equal number of thread-blocking workflows
1 parent fb3dccd commit 39bea32

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

.github/workflows/ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- "releases/*"
88

99
jobs:
10+
11+
nightly:
12+
uses: ./.github/workflows/run-bench.yml
13+
1014
# Build and test the project
1115
build-lint-test:
1216
strategy:

.github/workflows/run-bench.yml

-14
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,3 @@ jobs:
5555
- run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
5656
- run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
5757
- run: poe run-bench --workflow-count 100 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
58-
59-
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
60-
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
61-
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
62-
63-
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
64-
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
65-
- run: poe run-bench --workflow-count 1000 --max-cached-workflows 100 --max-concurrent 100 ${{ inputs.sandbox-arg }}
66-
67-
- run: poe run-bench --workflow-count 10000 --max-cached-workflows 10000 --max-concurrent 10000 ${{ inputs.sandbox-arg }}
68-
- run: poe run-bench --workflow-count 10000 --max-cached-workflows 10000 --max-concurrent 10000 ${{ inputs.sandbox-arg }}
69-
70-
- run: poe run-bench --workflow-count 10000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}
71-
- run: poe run-bench --workflow-count 10000 --max-cached-workflows 1000 --max-concurrent 1000 ${{ inputs.sandbox-arg }}

scripts/run_bench.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ async def bench_activity(name: str) -> str:
3131
return f"Hello, {name}!"
3232

3333

34+
@workflow.defn
35+
class DeadlockInterruptibleWorkflow:
36+
@workflow.run
37+
async def run(self) -> None:
38+
# Infinite loop, which is interruptible via PyThreadState_SetAsyncExc
39+
while True:
40+
pass
41+
42+
3443
async def main():
3544
logging.basicConfig(
3645
format="%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s",
@@ -86,6 +95,13 @@ async def report_mem():
8695
logger.debug("Starting %s workflows", args.workflow_count)
8796
pre_start_seconds = time.monotonic()
8897
handles = [
98+
await env.client.start_workflow(
99+
DeadlockInterruptibleWorkflow.run,
100+
id=f"deadlock-interruptible-workflow-{i}-{uuid.uuid4()}",
101+
task_queue=task_queue,
102+
)
103+
for i in range(args.workflow_count)
104+
] + [
89105
await env.client.start_workflow(
90106
BenchWorkflow.run,
91107
f"user-{i}",
@@ -101,7 +117,7 @@ async def report_mem():
101117
async with Worker(
102118
env.client,
103119
task_queue=task_queue,
104-
workflows=[BenchWorkflow],
120+
workflows=[BenchWorkflow, DeadlockInterruptibleWorkflow],
105121
activities=[bench_activity],
106122
workflow_runner=SandboxedWorkflowRunner()
107123
if args.sandbox

0 commit comments

Comments
 (0)