-
Couldn't load subscription status.
- Fork 293
CA-388295: Fix bugs from py2->py3 conversion in perfmon and hfx_filename #5373
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
cfa03dc to
c198405
Compare
|
@robhoes Given on xs8 we are doing stream release, maybe no patches will applied on xs8 stream, thus this script will not be used? (and no way to test it manually) But it may still good to keep this script just in case we want to support hotfix again someday in future? |
|
@stephenchengCloud Another issue may not related to your update. Regarding |
This is the error handling of this script (see line 56): if the input is not started with As for the |
c198405 to
5e9d593
Compare
|
XenRT test passed: 193536 Ring3 BST + BVT |
b06288f to
bba8937
Compare
6dbccc6 to
e942c81
Compare
f66094d to
32c368b
Compare
|
32c368b to
06db91c
Compare
|
Waiting for bernhard to rereview the changes. Is this passing tests that previously failed? Can we inspect the results? |
@bernhardkaindl Could you review this? Thanks. @psafont The tests previsously failed passed ( see job 3916062), but it has nothing to do with the perfmon script. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #5373 +/- ##
==========================================
+ Coverage 45.38% 46.60% +1.22%
==========================================
Files 18 21 +3
Lines 2937 3038 +101
==========================================
+ Hits 1333 1416 +83
- Misses 1604 1622 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Exception handling changes in python3:
user.log (job: 3919173) with python2 version perfmon:
user.log(job: 3921218) with python 3 version perfmon:
|
b2edccb to
1bea778
Compare
Signed-off-by: Stephen Cheng <stephen.cheng@cloud.com>
- socket.error and IOError have been merged into OSError in python3 see: https://docs.python.org/3/library/exceptions.html#IOError - HTTPError doesn't have content in `args` in python3 - Different exception classes Signed-off-by: Stephen Cheng <stephen.cheng@cloud.com>
1bea778 to
461716e
Compare
Signed-off-by: Stephen Cheng <stephen.cheng@cloud.com>
I think @bernhardkaindl has already shown you how to address this warning through his actions. see https://github.com/xapi-project/xen-api/pull/5418/files#diff-e0b8a152da73af5c15f34d1fd7200f74f77ef38c4197c77ac2abeb765e78f99aR249 |
461716e to
2891c85
Compare
|
Please change the target of the PR to the py3 feature branch. |
This is agreed with @psafont , bugfix goes to master, and the issues already there. |
| s.close() | ||
|
|
||
| def parse_string(txt): | ||
| assert txt is not None |
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.
Does this fix the original problem? It looks like 'rpc' may return on a non-200 error code, without raising an exception, and it'd instead fail on this assert here then.
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 is not for the original problem.
The original change is small. Much of the code if for passing the pytype and pylint check added recently.
This is for passing the pytype.
| memtype = item[0].strip() | ||
| size = item[1].strip() | ||
| match = re.search(r'\d+', size.strip()) | ||
| assert match |
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.
If there is no match this will raise an assertion error, it might be better to raise an error that gives you more information on what went wrong: in this case including the original size that we tried to match with the regex might be useful, so we see what it contains instead of digits.
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 change is not covered by tests.
When installing and configuring the Codecov plugin for Chrome- or Firefox-based browsers, a red bar is shown in front of these lines. I recommend submitters to install and configure it (more info later, I'm in a meeting now) or check the code coverage on the Link given by the Codecov.io - We also need to run mypy checks
- Since there are so many unresolved comments, and many changes, I think it's better to revert the Python3 changes as a fix, and move this to the Python3 branch instead to give this more time for review.
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 is also for passing the pytype check.
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.
Agree with @edwintorok.
I'm assuming your modification is inspired by @bernhardkaindl's draft PR (https://github.com/xapi-project/xen-api/pull/5365/files#r1458703889) to avoid pytype errors. However, it would be preferable to make more elegant adjustments to display insightful exceptions.
| # reset when reactivating | ||
| self.value = None | ||
| self.timeof_last_alarm = time.time() - self.alarm_auto_inhibit_period | ||
| self.trigger_down_counter = self.alarm_trigger_period |
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 duplicates code that previously wasn't duplicated.
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.
Also for passing the pytype check.
The original code is a class, and pytype complained that the class has no alarm_auto_inhibit_period and alarm_trigger_period attributes.
| memtype = item[0].strip() | ||
| size = item[1].strip() | ||
| match = re.search(r'\d+', size.strip()) | ||
| assert match |
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 change is not covered by tests.
When installing and configuring the Codecov plugin for Chrome- or Firefox-based browsers, a red bar is shown in front of these lines. I recommend submitters to install and configure it (more info later, I'm in a meeting now) or check the code coverage on the Link given by the Codecov.io - We also need to run mypy checks
- Since there are so many unresolved comments, and many changes, I think it's better to revert the Python3 changes as a fix, and move this to the Python3 branch instead to give this more time for review.
|
OK. I will revert the python3 changes for hfx_filename and perfmon. @bernhardkaindl @psafont @edwintorok @liulinC @acefei For this PR:
|
@psafont @edwintorok @bernhardkaindl @acefei @stephenchengCloud I am very very very disappointed it is sooooooo hard to merge such a tiny bugfix. |
Uh oh!
There was an error while loading. Please reload this page.