-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add refresh method to fake backends #1740
Conversation
Pull Request Test Coverage Report for Build 9455558491Details
💛 - Coveralls |
…fresh-fake-backend
Pull Request Test Coverage Report for Build 9500935091Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9516500365Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9568678069Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
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 little bit late, but I think this needs some changes.
if real_props: | ||
new_version = real_props.backend_version | ||
|
||
if new_version > version: |
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.
Can we really rely on the version
? I don't think it gets updated every time new calibration is pushed. And why even check the version if the server side data is already the freshest.
logger.info("There are no available new updates for %s.", self.backend_name) | ||
|
||
except Exception as ex: | ||
logger.info("The refreshing of %s has failed: %s", self.backend_name, str(ex)) |
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.
This should raise an exception or at least a warning. Info level log doesn't get surfaced by default.
"The backend %s has been updated from {version} to %s version.", | ||
self.backend_name, | ||
real_props.backend_version, | ||
) |
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.
This just updates the files but doesn't actually refresh the target
if it's already built since it's cached.
old_backend = FakeSherbrooke() | ||
with self.assertLogs("qiskit_ibm_runtime", level="INFO"): | ||
old_backend.refresh(self.service) | ||
new_backend = FakeSherbrooke() | ||
self.assertGreaterEqual(old_backend.backend_version, new_backend.backend_version) |
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 don't quite understand this test. If FakeSherbrooke currently has version 1. The server data has version 2. If the refresh()
code is not working correctly, both old_backend
and new_backend
would remain at version 1, and the test would still pass.
* improvements from #1740 * updated tests * updated refresh condition * style fixes * mypy warning * update name --------- Co-authored-by: Kevin Tian <kevin.tian@ibm.com>
Summary
Details and comments
Fixes #1707