Skip to content

Commit daea69b

Browse files
committed
corrected return submitted datetime
1 parent 7b4d0e5 commit daea69b

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

packages/pytest-simcore/src/pytest_simcore/helpers/faker_factories.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@
1616
import json
1717
import random
1818
from collections.abc import Callable
19-
from datetime import datetime, timedelta, timezone
19+
from datetime import UTC, datetime, timedelta
2020
from typing import Any, Final
2121
from uuid import uuid4
2222

23+
import arrow
2324
import faker
2425
from faker import Faker
2526

@@ -182,7 +183,7 @@ def fake_task_factory(first_internal_id=1) -> Callable:
182183
_index_in_sequence = itertools.count(start=first_internal_id)
183184

184185
def fake_task(**overrides) -> dict[str, Any]:
185-
t0 = datetime.utcnow()
186+
t0 = arrow.utcnow().datetime
186187
data = {
187188
"project_id": uuid4(),
188189
"node_id": uuid4(),
@@ -193,7 +194,6 @@ def fake_task(**overrides) -> dict[str, Any]:
193194
"outputs": json.dumps({}),
194195
"image": json.dumps({}),
195196
"state": random.choice(_get_comp_pipeline_test_states()),
196-
"submit": t0,
197197
"start": t0 + timedelta(seconds=1),
198198
"end": t0 + timedelta(minutes=5),
199199
}
@@ -251,7 +251,7 @@ def random_product(
251251

252252

253253
def utcnow() -> datetime:
254-
return datetime.now(tz=timezone.utc)
254+
return datetime.now(tz=UTC)
255255

256256

257257
def random_payment_method(

services/director-v2/tests/mocks/fake_task.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"requires_gpu": false,
5151
"requires_mpi": true
5252
},
53-
"submit": "1994-11-10T19:23:02.115Z",
5453
"state": "PUBLISHED",
5554
"internal_id": 21107840,
5655
"node_class": "COMPUTATIONAL",

services/director-v2/tests/unit/with_dbs/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ async def _(
118118
),
119119
"node_class": to_node_class(node_data.key),
120120
"internal_id": internal_id + 1,
121-
"submit": datetime.datetime.now(datetime.UTC),
122121
"job_id": generate_dask_job_id(
123122
service_key=node_data.key,
124123
service_version=node_data.version,

0 commit comments

Comments
 (0)