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 resetting proposal settings #889
Fix resetting proposal settings #889
Conversation
6c981bf
to
15d4fb0
Compare
a92c6b3
to
fdb2724
Compare
fdb2724
to
00bc177
Compare
ebe3607
to
89d70fb
Compare
89a93ce
to
54987c0
Compare
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.
Looks OK, but I'd leave the final approval on @ancorgs 😉
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.
I agree the #to_s
based tests may look a bit weird, but I don't think it makes the situation any worse than it was with those tests. So LGTM
Yes, looks better to me. |
I see some tests are starting to fail because "singleton can't be dumped". I suspect this is happening because "double" objects cannot be marshaled. Maybe we can fix it by replacing Or even better, we can avoid doubles at all, and simply create "real" |
a75490e
to
aa372fe
Compare
Thank you for your feedback. I already updated the PR with your suggestions, but I fix those tests that are failing. Using |
@dgdavid I was not sure about that solution (I was only guessing). First of all, we have to be sure that the problem is the combination of Marshall + mocking. This can be easily checked. And if we confirm that, then we have 3 options: a) try to use real VolumeSpecification objects in tests, although I don't like it because we force to always use real settings. So, if finally the problem is Marshal + mocking, IMHO I would go with option b) iff @ancorgs How do you see it? |
I wouldn't redefine Fixing the deep dup is the further I would go. |
So, I'll undo the Thank you! |
8adfcd3
to
3a01573
Compare
Based on a Marshal (de)serialization.
The default #dup creates a shallow and we were changing the semantic. Renaming it to a `deep_copy` is more consistent with its behavior.
Co-Authored-By: David Díaz González <dgonzalez@suse.de>
After changes done in SettingsGenerator, InitialGuidedProposal does not need to copy the original settings. Keeping a reference to them is enough.
Based on suggestions from code review Co-Authored-By: José Iván López González <jlopez@suse.com>
3a01573
to
cdfced4
Compare
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.
LGTM
Problem
Initial settings are not being restored before each proposal attempt because
See also,
Solution
Overwrite theAdded aProposalSettings#dup
ProposalSettings#deep_copy
method to make a copy based on aMarshal
serialization instead of useYast.deep_copy
becauseTesting