-
Notifications
You must be signed in to change notification settings - Fork 314
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
Fail benchmark if assertion could not run #1588
Fail benchmark if assertion could not run #1588
Conversation
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.
Thanks for picking this up.
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. This feels like it's not just sensible but correct, and I'm glad you've addressed it; agree it should go in the next minor
esrally/driver/runner.py
Outdated
@@ -404,7 +404,7 @@ async def __call__(self, *args): | |||
props = parse(return_value, assertion["property"]) | |||
self.check_assertion(op_name, assertion, props, props_expand_keys=False) | |||
else: | |||
self.logger.debug("Skipping assertion check in [%s] as [%s] does not return a dict.", op_name, repr(self.delegate)) | |||
raise exceptions.DataError(f"Cannot check assertion in [{op_name}] as [{repr(self.delegate)}] does not return a dict.") |
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.
The only nit I have here is that perhaps this could say did not return a dict
, as it could be that the operation typically returns a valid parseable response, but in this instance returned a stacktrace or something
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.
Thanks, I fixed that. Well it could also return JSON encoded as bytes in a BytesIO but I did not want to overcomplicate the error message.
Like the json module from the standard library, ijson expect bytes. While the signature of `parse()` is type hinted correctly, types are not enforced and many tests were passing a StringIO instance incorrectly. This produced deprecation warnings locally, but not on CI for unknown reasons.
When you 1/ enable assertions and 2/ have assertions in your track but 3/ the operation is returning an unsupported type, we used to only issue a debug log! I believe that we should instead complain loudly. This is technically breaking but will only report valid issues so I think it makes sense to include in the next minor version of Rally.
This was initially reported by @ywelsch in #1582 (comment).