-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix non-deterministic behaviour in ModelLoadingServiceTests #55008
Conversation
Pinging @elastic/ml-core (:ml) |
@@ -353,9 +353,9 @@ private void auditIfNecessary(String modelId, MessageSupplier msg) { | |||
logger.trace(() -> new ParameterizedMessage("[{}] {}", modelId, msg.get().getFormattedMessage())); | |||
return; | |||
} | |||
auditor.warning(modelId, msg.get().getFormattedMessage()); | |||
auditor.info(modelId, msg.get().getFormattedMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A model being evicted from the cache is a routine event and not a warning level event. I would prefer this to be debug as it really is a non-issue (the model will be reloaded if required) but there is very little insight into the internals of the cache (which models are loaded etc). Once we have a model management system this should be debug or trace.
I'm raising here for discussion before I forget but I'd be happy to revert the change for this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran the tests locally 1000s of times with this patch and passes 100% ✅
47e800c
to
42baf3f
Compare
ModelLoadingServiceTests::testMaxCachedLimitReached
is testing models get evicted from the cache when the total size of all the models is too large for the cache. There is some non-deterministic behaviour when the models are first loaded as it it known what order they are loaded in and therefore which will be evicted by a later load. This change adjusts the assertions to account for that uncertainty.I believe the non-deterministic behaviour comes from a loss of ordering going from a list of IDs to a set. Model loading is mocked so there shouldn't be a race there.
Closes #54986