You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
xUnit <testsuite timestamp> should be timezone-aware for unambiguous cross-timezone timing #5857
The xUnit writer emits <testsuite timestamp> from suite.start_time.isoformat(). Because start_time is a naive local datetime, the serialized value carries no UTC offset (e.g. 2026-11-01T12:30:00.123456). Any consumer that reads this timestamp to compute wall-clock timing across machines/timezones — or across a DST boundary — cannot resolve it to an unambiguous instant and can be off by hours. This bites tooling that aggregates xUnit results from CI runners in different timezones.
This is the same underlying tension discussed in #4074 (where the attribute was deliberately added in PyTest's naive format) and #4378 (format compatibility with strict consumers). Rather than re-open those, this issue asks specifically: should the timestamp carry a UTC offset so the instant is unambiguous?
Proposed change
Make the emitted timestamp offset-aware in src/robot/reporting/xunitwriter.py:
For naive values this assumes local time and appends the system offset without shifting the clock value; already-aware values are normalized to local, preserving the instant. Example: 2026-11-01T12:30:00.123456 → 2026-11-01T12:30:00.123456+05:30.
Open questions for maintainers
Local offset vs UTC..astimezone() uses the CI runner's local offset (machine-dependent). .astimezone(timezone.utc) would always emit +00:00, which is runner-independent and arguably the cleaner "unambiguous instant." Which is preferred?
JUnit schema compatibility. The commonly-referenced JUnit XSD documents "Timezone may not be specified" (noted in invalid timestamp format in xunit reports #4378). An offset is still valid ISO-8601 / xs:dateTime, but strict validators built on that XSD may reject it. Is that acceptable, or would you prefer this stay naive?
I have a branch ready (one-line writer change + acceptance-test updates in atest/robot/output/xunit.robot and atest/robot/rebot/xunit.robot) and am happy to open a PR in whichever form you prefer.
It would be great if timestamps had timezone information, but I'm afraid adding them could break existing tools. To make this change, these two conditions must be met:
There are concrete needs for timezone information. This most importantly means use cases where the information is actually used for something. Can you @ItIsUday clarify your needs? Notice that I don't consider tools that cannot parse timestamps without timezones (like in invalid timestamp format in xunit reports #4378) relevant, because all producers don't include that information and consumers should thus anyway handle the situation.
This change doesn't break too many existing tools. It's impossible to test all possible tools, but someone should test at least junitparser and Jenkins. Probably should ask also on our Slack what xUnit file consumers people use, test them, and ask opinions from the community in general. Are you @ItIsUday interested to do that?
If there are concrete benefits from the change and the change isn't too badly backwards incompatible, we can do that in RF 8.0. Another alternative would be making our xUnit output configurable, but we have decided to leave that for external tools like xunitmodifier.
Activity
pekkaklarck commentedon Nov 13, 2026
It would be great if timestamps had timezone information, but I'm afraid adding them could break existing tools. To make this change, these two conditions must be met:
If there are concrete benefits from the change and the change isn't too badly backwards incompatible, we can do that in RF 8.0. Another alternative would be making our xUnit output configurable, but we have decided to leave that for external tools like xunitmodifier.