Scenario Risk QA test failure on 32-bit machine (CI)

Bug #979876 reported by Lars Butler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenQuake (deprecated)
Fix Released
Critical
Lars Butler

Bug Description

This error:
http://ci.openquake.org/job/oq-engine/487/testReport/junit/qa_tests.scenario_risk_unittest/ScenarioRiskQATest/test_scenario_risk_sample_based/

Failed

qa_tests.scenario_risk_unittest.ScenarioRiskQATest.test_scenario_risk_sample_based (from nosetests)

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/python2.7/unittest/case.py", line 327, in run
    testMethod()
  File "/var/lib/jenkins/jobs/oq-engine/workspace/qa_tests/scenario_risk_unittest.py", line 191, in test_scenario_risk_sample_based
    self._verify_loss_map(expected_loss_map_file, expected_loss_map)
  File "/var/lib/jenkins/jobs/oq-engine/workspace/qa_tests/scenario_risk_unittest.py", line 63, in _verify_loss_map
    self, expected_data, actual_lm_data, places=self.LOSSMAP_PRECISION)
  File "/var/lib/jenkins/jobs/oq-engine/workspace/tests/utils/helpers.py", line 337, in assertDeepAlmostEqual
    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
Revision history for this message
Lars Butler (lars-butler) wrote :

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.

Revision history for this message
Lars Butler (lars-butler) wrote :
Changed in openquake:
status: Confirmed → In Progress
Changed in openquake:
status: In Progress → Fix Committed
Changed in openquake:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.