-
Notifications
You must be signed in to change notification settings - Fork 48
fix: make dogpile.cache.memory preserve its init parameters
#274
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
Conversation
zzzeek
left a comment
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.
so I'm a little curious what the use case to add non-consumed keys to the argument dictionary is, but at the same time it's clear the other backends have explicit code to prevent them from mutating the given dictionary so this patch is mostly about getting explicit test coverage for that, so let's do that with explicit tests. thanks for the PR
dogpile/testing/fixtures.py
Outdated
| backend = backend_cls(arguments) | ||
| # Fail the test if the parameters have been altered by the backend | ||
| # setup; the results in such cases should be considered suspect | ||
| if arguments != stashed: |
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 played with this a bit and in pytest it produces an ERROR rather than FAILURE. I think this would be better done in an explicit test with a few scenarios:
- arguments that we know are consumed, remain in the dictionary
- arguments that we know are not consumed, remain in the dictionary
- no new keys are added to the dictionary
these tests would be added to _GenericBackendTestSuite.
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 was proposing new tests be added here to _GenericBackendTestSuite, which I dont see in the PR here. These can be added to the PR, dont worry about gerrit
sqla-tester
left a comment
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.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 759dc77 of this pull request into gerrit so we can run tests and reviews and stuff
|
New Gerrit review created for change 759dc77: https://gerrit.sqlalchemy.org/c/sqlalchemy/dogpile.cache/+/6084 |
The use case is pedestrian enough that I'm shocked it hasn't ever come up: I have a library that uses I currently have a guard against this behavior in place, but it seems like mutating inputs for no discernible reason should be frowned upon, at a minimum. As for the workflow going forward, I am mildly confused. A robot appears to have migrated this into Gerrit (I used to work on OpenStack! I love and miss Gerrit!) but all of the comments still appear to be over here, and I don't have rights to see the Jenkins results over there. Do I push changes here, and they sync, or do I pivot to |
|
right so it's complicated short answer, leave the comments here, just work w/ the PR like nothing is going on. jenkins and now gerrit are behind a password because we have swarm bots crawling them and crashing my server (they are both heavy java VMs and can't serve requests that fast without pushing the load to 35). I'm going to see if cloudflare or something can fix this |
|
the suites that failed are:
and
for the latter one I'd install pre-commit which will do the checks before you commit |
|
jenkins and gerrit should be open now |
Make the `MemoryBackend` behave like the others, and stop removing keys from the initialization dict. Fixes: Issue sqlalchemy#273 Closes: sqlalchemy#274 Pull-request: sqlalchemy#274 Pull-request-sha: 759dc77 Change-Id: Ifd3f0d88b18a73a0ce287e1a514a6268daf157c4
Jenkins is accessible, but your Gerrit SSH endpoint seems unhappy (web UI works fine). I'll try pushing here to see if it works itself out. |
Make the `MemoryBackend` behave like the others, and stop removing keys from the initialization dict. Drive-by: fix some PEP8 and PEP484 errors in unrelated files Fixes: Issue sqlalchemy#273 Closes: sqlalchemy#274 Pull-request: sqlalchemy#274 Pull-request-sha: 759dc77 Change-Id: Ifd3f0d88b18a73a0ce287e1a514a6268daf157c4
ive moved the ssh endpoint to ssh.gerrit.sqlalchemy.org |
sqla-tester
left a comment
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.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision d3128bf of this pull request into gerrit so we can run tests and reviews and stuff
sqla-tester
left a comment
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.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision d3128bf of this pull request into gerrit so we can run tests and reviews and stuff
|
sorry for the troubles, we had to put gerrit behind cloudflare because bots were bringing the server down, so now we're juts hitting all the problems w that |
|
Michael Bayer (zzzeek) wrote: when flake8 and friends have updates, things break. we could of course pin the versions but then we'd never upgrade it, so ill push fixes for whatever it is and you can rebase. not sure who knows/doesnt but gerrit /jenkins should be fully accessible now, the worst you should get is a cloudflare clickthrough page maybe but probably/hopefully not. View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/dogpile.cache/+/6084 |
sqla-tester
left a comment
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.
Michael Bayer (zzzeek) wrote:
lets:
- rebase on main, I've fixed pep8/pep484
- revert the fixes for pep8/pep484 which are addressed by main
- make the remaining changes from my gh review in the test suite (dont cause setup errors, add dedicated all-backend test for dictionary not mutated)
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/dogpile.cache/+/6084
|
Michael Bayer (zzzeek) wrote: Done View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/dogpile.cache/+/6084 |
Make the `MemoryBackend` behave like the others, and stop removing keys from the initialization dict. Fixes: Issue sqlalchemy#273 Closes: sqlalchemy#274 Pull-request: sqlalchemy#274 Pull-request-sha: 759dc77 Change-Id: Ifd3f0d88b18a73a0ce287e1a514a6268daf157c4
sqla-tester
left a comment
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.
Nicolas Simonds (0xDEC0DE) wrote:
The Gerrit SSH server claims I don't have write permission to push changes, but it's been a minute since I've used the Gerrit workflow, and I've likely forgotten the correct steps. I just shoved the changes into Github, since you appear to have the needed automation to sync things up, and that appears to work.
Sorry for all the noise and drama, I just wanted to give you a simple little fix! 😄
View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/dogpile.cache/+/6084
- dogpile/cache/backends/memcached.py (line 21): Done
- dogpile/cache/region.py (line 820): Done
- dogpile/testing/fixtures.py (line 39): Done
|
right you dont have gerrit write perms, it's a closed server. we dont make people learn gerrit we just synchronize their commits from their PR to our own gerrit server. i mean if you were contributing a lot, we could set you up with gerrit access, but it's just this one PR for now. |
sqla-tester
left a comment
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.
OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision b893879 of this pull request into gerrit so we can run tests and reviews and stuff
|
Patchset b893879 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/dogpile.cache/+/6084 |
|
this seems now a subset of #270 |
|
OK, still waiting for generic tests so if #270 can add this, will transfer this to that one |
|
I want this general fix in so I'm going to finish it up now |
|
(another win for gerrit I still have your code! :) ) |
|
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/dogpile.cache/+/6084 has been merged. Congratulations! :) |
Make the
MemoryBackendbehave like the others, and stop removing keys from the initialization dict.Fixes: Issue #273