fix(server): flaky metadata tests#26964
Merged
danieldietzler merged 1 commit intomainfrom Mar 17, 2026
Merged
Conversation
Dates on the asset factory use the current time, and they are usually all the same time, but may occasionally be a millisecond out. This behaviour hid the fact that some tests were asserting against the wrong field, and would flake. We can resolve this by ensuring that each date on a test asset is unique.
danieldietzler
approved these changes
Mar 17, 2026
Member
danieldietzler
left a comment
There was a problem hiding this comment.
I am wondering if we'd want some sort of randomization in the newDate instead. I suppose this is fine though
Collaborator
Author
|
Maybe, though it might be weird to have an updated at before a created at, so this ordering kinda makes sense? |
brucethomax
pushed a commit
to brucethomax/immich
that referenced
this pull request
Mar 19, 2026
okxint
pushed a commit
to okxint/immich
that referenced
this pull request
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Dates on the asset factory use the current time, and they are usually all the same time, but may occasionally be a millisecond out. This behaviour hid the fact that some tests were asserting against the wrong field, and would flake.
We can resolve this by ensuring that each date on a test asset is unique.
How Has This Been Tested?
Ran the tests.
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
N/A