MODEXPW-651: buildContext_setsCreatedAt: Optional fractional second - #751
MODEXPW-651: buildContext_setsCreatedAt: Optional fractional second #751julianladisch wants to merge 2 commits into
Conversation
…tedAt https://folio-org.atlassian.net/browse/MODEXPW-651 OrderEmailContextMapperTest.buildContext_setsCreatedAt:177 fails in about .1 % of all runs with this error: ``` Expecting actual: "2026-08-11T15:33:47Z" to match pattern: "\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z" ``` Example: https://github.com/folio-org/mod-data-export-worker/actions/runs/31503434083/job/93819003252 Fix the expected pattern by making the fractional second optional.
|
@julianladisch thanks for the investigation and the solution. I don’t think fixing the test at this point is the ideal approach. The test is green after the change, but the result for createdAt is then inconsistent. IMO this could mean that we would potentially have to add additional conditions everywhere createdAt is used. I would therefore prefer to focus on keeping the result of the implementation consistent at this point. I’ve implemented a proposal for this. https://github.com/slub/mod-data-export-worker/commits/MODEXPW-651 I can overwrite the changes of your branch or provide an alternative one. Alternatively, you can also cherry-pick the changes or simply copy them over. If you have a better idea for the implementation, I’m of course open to that as well. |
|
markusweigelt
left a comment
There was a problem hiding this comment.
The implementation should be changed instead of adjusting the tests.
|
Agreed. Closing this PR. Replaced with https://github.com/slub/mod-data-export-worker/commits/MODEXPW-651 |
|
Replacement PR: #752 |



https://folio-org.atlassian.net/browse/MODEXPW-651
Purpose
Avoid spurious test failures.
OrderEmailContextMapperTest.buildContext_setsCreatedAt:177 fails in about .1 % of all runs with this error:
Example: https://github.com/folio-org/mod-data-export-worker/actions/runs/31503434083/job/93819003252
Approach
Fix the expected pattern by making the fractional second optional.
Pre-Merge Checklist:
Before merging this PR, please go through the following list and take appropriate actions.