Skip to content

Commit a75b040

Browse files
committed
CI fix
1 parent bcbe4fa commit a75b040

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- run: poetry install --no-root -E opentelemetry
4444
- run: poe lint
4545
- run: poe build-develop
46-
- run: poe test -s -o log_cli_level=DEBUG
46+
- run: poe test -x -s -o log_cli_level=DEBUG
4747
- run: poe test -s -o log_cli_level=DEBUG --workflow-environment time-skipping
4848

4949
# Confirm protos are already generated properly

temporalio/testing/workflow.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ async def start_local(
9191
temporalite_existing_path: Optional[str] = None,
9292
temporalite_database_filename: Optional[str] = None,
9393
temporalite_log_format: str = "pretty",
94-
# TODO(cretz): Document that you can set to None to translate from Python level
9594
temporalite_log_level: Optional[str] = "warn",
9695
temporalite_download_version: str = "default",
9796
temporalite_extra_args: Sequence[str] = [],

tests/testing/test_workflow.py

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import logging
23
import uuid
34
from datetime import datetime, timedelta, timezone
45
from time import monotonic
@@ -18,6 +19,8 @@
1819
from temporalio.testing import WorkflowEnvironment
1920
from tests.worker.test_workflow import new_worker
2021

22+
logger = logging.getLogger(__name__)
23+
2124

2225
@workflow.defn
2326
class ReallySlowWorkflow:
@@ -36,29 +39,45 @@ async def some_signal(self) -> None:
3639

3740

3841
async def test_workflow_env_time_skipping_basic():
39-
async with await WorkflowEnvironment.start_time_skipping() as env:
40-
async with new_worker(env.client, ReallySlowWorkflow) as worker:
41-
# Check that time is around now
42-
assert_timestamp_from_now(await env.get_current_time(), 0)
43-
# Run workflow
44-
assert "all done" == await env.client.execute_workflow(
45-
ReallySlowWorkflow.run,
46-
id=f"workflow-{uuid.uuid4()}",
47-
task_queue=worker.task_queue,
48-
)
49-
# Check that the time is around 100000 seconds after now
50-
assert_timestamp_from_now(await env.get_current_time(), 100000)
42+
print("CI LOGA1")
43+
try:
44+
async with await WorkflowEnvironment.start_time_skipping() as env:
45+
print("CI LOGA2")
46+
async with new_worker(env.client, ReallySlowWorkflow) as worker:
47+
print("CI LOGA3")
48+
# Check that time is around now
49+
assert_timestamp_from_now(await env.get_current_time(), 0)
50+
# Run workflow
51+
print("CI LOGA4")
52+
assert "all done" == await env.client.execute_workflow(
53+
ReallySlowWorkflow.run,
54+
id=f"workflow-{uuid.uuid4()}",
55+
task_queue=worker.task_queue,
56+
)
57+
print("CI LOGA5", datetime.now())
58+
# Check that the time is around 100000 seconds after now
59+
assert_timestamp_from_now(await env.get_current_time(), 100000)
60+
print("CI LOGA6", datetime.now())
61+
print("CI LOGA7", datetime.now())
62+
print("CI LOGA8", datetime.now())
63+
except:
64+
logger.exception("OH NO")
65+
raise
5166

5267

5368
async def test_workflow_env_time_skipping_manual():
69+
print("CI LOGB1", datetime.now())
5470
async with await WorkflowEnvironment.start_time_skipping() as env:
71+
print("CI LOGB2", datetime.now())
5572
async with new_worker(env.client, ReallySlowWorkflow) as worker:
73+
print("CI LOGB3", datetime.now())
5674
# Start workflow
5775
handle = await env.client.start_workflow(
5876
ReallySlowWorkflow.run,
5977
id=f"workflow-{uuid.uuid4()}",
6078
task_queue=worker.task_queue,
6179
)
80+
print("CI LOGB4")
6281

6382
async def workflow_current_time() -> float:
6483
# We send signal first since query timestamp is based on last
@@ -67,11 +86,17 @@ async def workflow_current_time() -> float:
6786
return await handle.query(ReallySlowWorkflow.current_time)
6887

6988
# Confirm query will say we're near current time
89+
print("CI LOGB5")
7090
assert_timestamp_from_now(await workflow_current_time(), 0)
7191

7292
# Sleep and confirm query will say we're near that time
93+
print("CI LOGB6")
7394
await env.sleep(1000)
95+
print("CI LOGB7")
7496
assert_timestamp_from_now(await workflow_current_time(), 1000)
97+
print("CI LOGB8")
98+
print("CI LOGB9")
99+
print("CI LOGB10")
75100

76101

77102
class Activities:

0 commit comments

Comments
 (0)