Solution: fix update_job_state/3 in the Quantum.Storage.Test macro - #720
Closed
dajiaohuang wants to merge 1 commit into
Closed
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
A storage defined with `use Quantum.Storage.Test` sent only the job name in
its `update_job_state/3` notification and returned the new state to the
caller. The `Quantum.Storage` callback returns `:ok` and `Quantum.JobBroadcaster`
matches it as such, so activating or deactivating a job crashed the job
broadcaster with a `MatchError` for every storage built with the macro.
Send `{job_name, state}`, as the module-level implementation in the same file
already does, and let the helper return its default `:ok`.
Adds a regression test that deactivates a job on a storage built with the macro.
Member
|
Based on the fact that I got 5 notifications of PRs in as many projects in less than 30 minutes, this looks like AI spam. If I want an AI to fix stuff, I'll ask my own. Closing. |
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.
A storage defined with
use Quantum.Storage.Testnotified only the job name inupdate_job_state/3and returned the new state to the caller. TheQuantum.Storagecallback returns:ok, andQuantum.JobBroadcastermatches it as such, soactivate_job/2anddeactivate_job/2crashed the job broadcaster with aMatchErrorfor every storage built with the macro.The module-level implementation in the same file already sends
{:update_job_state, {job_name, state}}and returns:ok; the macro now does the same, and the regression test deactivates a job on a storage built with the macro.Verified on the branch with
mix test,mix format --check-formatted,mix credo --strictandmix dialyzer.