Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/backends/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BackendDouble(ThreadmillTaskBackend):
def enqueue(self, task, args, kwargs):
return TaskResult(
task=task,
id=str(uuid.uuid4()),
id=str(uuid.uuid7()),
status=TaskResultStatus.READY,
enqueued_at=timezone.now(),
started_at=None,
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_serialize_task_result__omits_retry_when_none(self) -> None:
task = RetryTask(func=echo.func)
result = TaskResult(
task=task,
id=str(uuid.uuid4()),
id=str(uuid.uuid7()),
status=TRS.READY,
enqueued_at=tz.now(),
started_at=None,
Expand Down Expand Up @@ -321,7 +321,7 @@ def _task_result_with_retry(task, *, errors=None, worker_ids=None) -> TaskResult
now = tz.now()
return TaskResult(
task=task,
id=str(uuid.uuid4()),
id=str(uuid.uuid7()),
status=TRS.FAILED,
enqueued_at=now,
started_at=now,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _task_result(task, *args, **kwargs) -> TaskResult:
"""Build a READY `TaskResult` without touching Redis."""
return TaskResult(
task=task,
id=str(uuid.uuid4()),
id=str(uuid.uuid7()),
status=TaskResultStatus.READY,
enqueued_at=timezone.now(),
started_at=None,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def _context(*, attempt: int, exception_class: type[Exception]) -> TaskContext:
"""Build a TaskContext with a single error of the given exception class."""
result = TaskResult(
task=print,
id=str(uuid.uuid4()),
id=str(uuid.uuid7()),
status=TaskResultStatus.FAILED,
enqueued_at=timezone.now(),
started_at=timezone.now(),
Expand Down Expand Up @@ -132,7 +132,7 @@ def test_serialize__roundtrips_through_task_result(self) -> None:
task = RetryTask(func=echo.func, retry=backoff)
result = TaskResult(
task=task,
id=str(uuid.uuid4()),
id=str(uuid.uuid7()),
status=TaskResultStatus.FAILED,
enqueued_at=timezone.now(),
started_at=timezone.now(),
Expand Down
2 changes: 1 addition & 1 deletion tests/testapp/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def io_workload():
@task(queue_name="memory")
def memory_workload():
"""Allocate and leak 100MB of memory."""
leak[uuid.uuid4()] = "x" * 1024 * 1024 * 100
leak[uuid.uuid7()] = "x" * 1024 * 1024 * 100


@task()
Expand Down
2 changes: 1 addition & 1 deletion threadmill/backends/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def enqueue(
enqueued_at = timezone.now()
task_result = TaskResult(
task=task,
id=str(uuid.uuid4()),
id=str(uuid.uuid7()),
status=TaskResultStatus.READY,
enqueued_at=enqueued_at,
started_at=None,
Expand Down
Loading