Sometimes TypeError occurred in risk_report.py in CQ.
The stack trace is the below.
https://luci-milo.appspot.com/buildbot/chromeos/master-paladin/17465
[1;31m19:49:59: ERROR: Traceback (most recent call last):
File "/b/c/cbuild/repository/chromite/cbuildbot/stages/generic_stages.py", line 701, in Run
self.PerformStage()
File "/b/c/cbuild/repository/chromite/cbuildbot/stages/report_stages.py", line 1050, in PerformStage
logging.PrintBuildbotStepText(risk_report.CLRiskText(build_id))
File "/b/c/cbuild/repository/chromite/lib/risk_report.py", line 41, in CLRiskText
top_risky = _TopRisky(risks)
File "/b/c/cbuild/repository/chromite/lib/risk_report.py", line 71, in _TopRisky
cl: risk for cl, risk in risks.iteritems()
File "/b/c/cbuild/repository/chromite/lib/risk_report.py", line 72, in <dictcomp>
if risk >= risks[top_key] * _CLOSE_TO_TOP_RATIO
TypeError: unsupported operand type(s) for *: 'dict' and 'float'
risk_report.py downloads a json file and read it to risks.
https://chromiumos-cl-scanner.appspot.com/external/risk/build/2205039
{
"cls": {
"681656": 0.0030543117260210047,
"757122": 0.00057718521861042232,
"782262": 0.00099129762934017907,
"806446": 0.00042256544195190684,
"807387": 0.00042197354935494388,
"807388": 0.00038750067560751252,
....
"862528": 0.0019327867218385426,
"862733": 0.00057703076762472146,
"862985": 0.0035788246155504812
}
}
top_key is "cls" and thus it returns dict.
I guess json format in the site was changed but risk_report.py didn't correspond the format.
I guess why it's successful sometimes, is there is a case which risk_report.py doesn't execute.
Comment 1 by hiroh@chromium.org
, Jan 12 2018