Scenario Risk QA test failure on 32-bit machine (CI)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake (deprecated) |
Fix Released
|
Critical
|
Lars Butler |
Bug Description
Failed
qa_tests.
Failing for the past 1 build (Since #487 )
Took 11 min.
add description
Error Message
193.949563098 != 193.233919602 within 4 places
TRACE: ROOT -> 0 -> 'mean'
Stacktrace
Traceback (most recent call last):
File "/usr/lib/
testMethod()
File "/var/lib/
self.
File "/var/lib/
self, expected_data, actual_lm_data, places=
File "/var/lib/
raise exc
AssertionError: 193.949563098 != 193.233919602 within 4 places
TRACE: ROOT -> 0 -> 'mean'
Changed in openquake: | |
status: | New → Confirmed |
importance: | Undecided → High |
importance: | High → Critical |
assignee: | nobody → Lars Butler (lars-butler) |
milestone: | none → 0.7.0 |
Changed in openquake: | |
status: | In Progress → Fix Committed |
Changed in openquake: | |
status: | Fix Committed → Fix Released |
The problem is that the epsilon random seed parameter was being passed to Random.seed() as a string (instead of being cast as an int first). Since our CI server runs on a 32-bit machine, the hash value of the seed was different than 64-bit machines running the same code. The solution was a one-line: cast the seed to an int.
This does not completely solve the issue, however, but as long as values are chosen from the interval [-2147483648, 2147483647] (a 32-bit singed int), the random sampling done in the scenario risk calculator will behave the same on 64-bit and 32-bit machines.