Skip to content

Conversation

@LorenzMende
Copy link
Contributor

@LorenzMende LorenzMende commented Aug 25, 2019

detailed: fixed decoding of typeperf in regrtest for win environments, added lookup for locations dependent typeperf key

https://bugs.python.org/issue36670

detailed: fixed decoding of typeperf in regrtest for win environments, added lookup for locations dependent typeperf key
if line.strip() == '' or '\\\\' in line or len(toks) != 2:
continue

load = float(toks[1].replace('"', ''))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're here, could you handle the case where float raises a ValueError (or maybe a TypeError? But I think we're guaranteed to only get ValueErrors at this point)? We can continue to the next line in that case.

Copy link
Contributor Author

@LorenzMende LorenzMende Aug 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi zooba,
what about

Suggested change
load = float(toks[1].replace('"', ''))
try:
toks = line.strip().split(',')
load = float(toks[-1].replace('"', ''))
except:
continue

this would handle the ValueError/ TypeError as well as take care of the line parsing.
Or is the bare exception handling unfavourable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LorenzMende That looks like a good option to me. You'll have to merge the change yourself though - I don't have permissions to your PR branch.

@ammaraskar
Copy link
Member

If it's not too much work, could you create a PR with your alternative solution from bpo whereby you raise early and the load average calculation gets disabled.

This really feels like a lot of extra complexity for not much gain, the primary reason system load averages are reported in regrtest is to track down flaky parallel/race condition/non deterministic tests. Those are primarily run on CI machines and build-bots which are almost always English machines anyway

@vstinner
Copy link
Member

vstinner commented Oct 1, 2019

I merged PR #16511 which is contains a similar fix, but also multiple other regrtest bugfixes.

@vstinner vstinner closed this Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants