Skip to content
Snippets Groups Projects
Unverified Commit e9f1e836 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

simulator: Fix timestamps manipulation

It's unclear whether the change in this mr triggers the bug in the simulator.
But it should be timestamp that needs manipulation and it's currently
datetimes. So this makes the current state fails with [1]

Adding the conversion layer from datetime to timestamps make the tests happier.

[1]
```
16:17:06  low = datetime.datetime(2025, 3, 14, 15, 17, 2, 139077, tzinfo=datetime.timezone.utc)
16:17:06  high = datetime.datetime(2025, 3, 14, 15, 17, 2, 139077, tzinfo=datetime.timezone.utc)
16:17:06
16:17:06      def _diff(low, high):
16:17:06          if low == high:
16:17:06              if low == 0:
16:17:06                  return 0.5
16:17:06              else:
16:17:06  >               return abs(low * 0.1)
16:17:06  E               TypeError: unsupported operand type(s) for *: 'datetime.datetime' and 'float'
16:17:06
```

Refs. swh/infra/sysadm-environment#5512
parent fed21704
No related branches found
No related tags found
No related merge requests found
Pipeline #14036 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment