lhopps / grit-i18n

Automatically exported from code.google.com/p/grit-i18n
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Couple of policy_templates.writers tests failing with randomized hash values #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When hash value randomization is turned on in Python 2.7.3. and up (it is on by 
default for Python 3.3 and up), the following tests fail once every 10 runs or 
so.  See http://bugs.python.org/issue13703 for context on why hash value 
randomization is done.

Easiest way to test is on a Google-internal machine. See Google-internal info 
on this at http://go/lixvg

======================================================================
FAIL: testDictionaryPolicy 
(grit.format.policy_templates.writers.json_writer_unittest.JsonWriterUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/work/f99236681aa92b17eec3f07013049c15/google3/runfiles/google3/third_party/py/grit/../grit/format/policy_templates/wr
iters/json_writer_unittest.py", line 272, in testDictionaryPolicy
    self.CompareOutputs(output, expected_output)
  File "/build/work/f99236681aa92b17eec3f07013049c15/google3/runfiles/google3/third_party/py/grit/../grit/format/policy_templates/wr
iters/json_writer_unittest.py", line 48, in CompareOutputs
    expected_output.strip())
AssertionError: u'// Policy template for Linux.\n// Uncomment the policies you 
wish to activate and change their values to\n// somet
hing useful for your case. The provided values are for reference only\n// and 
do not provide meaningful defaults!\n{\n  // Example D
ictionary Policy\n  
//-------------------------------------------------------------------------\n  
// Example Dictionary Policy\n\n
 //"DictionaryPolicy": {\'int\': 10, \'dict\': {\'a\': 1, \'b\': 2}, \'string\': \'abc\', \'list\': [1, 2, 3], \'bool\': True}\n\n}'
 != '// Policy template for Linux.\n// Uncomment the policies you wish to activate and change their values to\n// something useful f
or your case. The provided values are for reference only\n// and do not provide 
meaningful defaults!\n{\n  // Example Dictionary Pol
icy\n  
//-------------------------------------------------------------------------\n  
// Example Dictionary Policy\n\n  //"Dictionar
yPolicy": {\'int\': 10, \'list\': [1, 2, 3], \'string\': \'abc\', \'dict\': 
{\'a\': 1, \'b\': 2}, \'bool\': True}\n\n}'

======================================================================
FAIL: testDictionaryPolicy 
(grit.format.policy_templates.writers.reg_writer_unittest.RegWriterUnittest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/work/f99236681aa92b17eec3f07013049c15/google3/runfiles/google3/third_party/py/grit/../grit/format/policy_templates/writers/reg_writer_unittest.py", line 251, in testDictionaryPolicy
    self.CompareOutputs(output, expected_output)
  File "/build/work/f99236681aa92b17eec3f07013049c15/google3/runfiles/google3/third_party/py/grit/../grit/format/policy_templates/writers/reg_writer_unittest.py", line 37, in CompareOutputs
    expected_output.strip())
AssertionError: 'Windows Registry Editor Version 
5.00\r\n\r\n[HKEY_LOCAL_MACHINE\\Software\\Policies\\Chromium]\r\n"DictionaryPol
icy"="{\'int\': 10, \'dict\': {\'a\': 1, \'b\': 2}, \'string\': \'abc\', 
\'list\': [1, 2, 3], \'bool\': True}"' != 'Windows Registry Editor Version 
5.00\r\n\r\n[HKEY_LOCAL_MACHINE\\Software\\Policies\\Chromium]\r\n"DictionaryPol
icy"="{\'int\': 10, \'list\': [1, 2, 3], \'string\': \'abc\', \'dict\': {\'a\': 
1, \'b\': 2}, \'bool\': True}"'

Original issue reported on code.google.com by joi@chromium.org on 10 Apr 2013 at 11:59

GoogleCodeExporter commented 9 years ago
Revision 121 fixes the issue.

Original comment by pastarmovj@chromium.org on 15 May 2013 at 1:47