Bug 1434813 - Fix integer overflow of places.database.lastMaintenance in testing/profiles/prefs_general.js. r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 01 Feb 2018 15:40:32 +1100
changeset 749923 a9ce3cd892a796726d4a7077b705204d1c9a30b0
parent 749921 1afdba933156fc334921e7924e5edca02050e295
child 750075 8ebdf597ade8b7c25edd3ea75babd721f28fc4a3
push id97521
push usernnethercote@mozilla.com
push dateThu, 01 Feb 2018 04:40:52 +0000
reviewersglandium
bugs1434813, 1383896, 1423840, 1424030
milestone60.0a1
Bug 1434813 - Fix integer overflow of places.database.lastMaintenance in testing/profiles/prefs_general.js. r=glandium. Bug 1383896 added this constant to testing/talos/talos/config.py: > FAR_IN_FUTURE = 7258114800 which is used as the value for the "places.database.lastMaintenance" pref. (7258114800 seconds after 1970 is the start of the year 2200.) libpref stores integers prefs as int32_t and the current parser doesn't detect overflow. So this overflows to -1331819792. (I detected this with the new prefs parser from bug 1423840, which does detect integer overflow.) As a result the condition testing this pref in toolkit/components/places/PlacesCategoriesStarter.js ends up always succeeding in tests, which is the exact opposite of what was intended. This patch changes it to 2147483647 (the year 2038), the maximum int32_t value. (Note: this is much the same as bug 1424030, which was fixed recently.) MozReview-Commit-ID: AQw4b8tmE9u
testing/talos/talos/config.py
--- a/testing/talos/talos/config.py
+++ b/testing/talos/talos/config.py
@@ -12,17 +12,21 @@ from mozlog.commandline import setup_log
 from talos import utils, test
 from talos.cmdline import parse_args
 
 
 class ConfigurationError(Exception):
     pass
 
 
-FAR_IN_FUTURE = 7258114800
+# Set places maintenance far in the future (the maximum time possible in an
+# int32_t) to avoid it kicking in during tests. The maintenance can take a
+# relatively long time which may cause unnecessary intermittents and slow
+# things down. This, like many things, will stop working correctly in 2038.
+FAR_IN_FUTURE = 2147483647
 
 DEFAULTS = dict(
     # args to pass to browser
     extra_args='',
     buildid='testbuildid',
     init_url='getInfo.html',
     env={'NO_EM_RESTART': '1'},
     # base data for all tests