Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Issue 14940026: Fixes the policy template generator to work predictably even with Python hash randomization turned … (Closed)

Created:
7 years, 7 months ago by pastarmovj
Modified:
7 years, 7 months ago
Reviewers:
Jói
CC:
grit-developer_googlegroups.com
Visibility:
Public.

Description

Fixes the policy template generator to work predictably even with Python hash randomization turned on. Unit tests that were using directly str() on dictionaries were failing in a flaky manner when hash randomization is switched on because the order in which dictionary entries are printed is not stable anymore. To fix this we always sort the dictionaries in alphabetic order in values to make this behavior stable and predictable. BUG=18 TEST=Run unit tests with python 2.7+ and the -R flag and verify that they are not flaky. Committed: https://code.google.com/p/grit-i18n/source/detail?r=121

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -10 lines) Patch
M grit/format/policy_templates/policy_template_generator.py View 3 chunks +17 lines, -0 lines 0 comments Download
M grit/format/policy_templates/writers/json_writer_unittest.py View 3 chunks +3 lines, -5 lines 0 comments Download
M grit/format/policy_templates/writers/reg_writer_unittest.py View 3 chunks +3 lines, -5 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
pastarmovj
Hey Joi, sorry for the delay on that but it slipped out of the radar ...
7 years, 7 months ago (2013-05-14 14:25:23 UTC) #1
Jói
LGTM, thanks for the fix!
7 years, 7 months ago (2013-05-14 19:53:46 UTC) #2
pastarmovj
7 years, 7 months ago (2013-05-15 08:43:18 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 manually as r121 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698