regrtest now warms up caches: create explicitly all internal
singletons which are created on demand to prevent false positives
when checking for reference leaks.
if slaveargs is not None:
args, kwargs = json.loads(slaveargs)
+ if kwargs['huntrleaks']:
+ warm_caches()
if testdir:
kwargs['testdir'] = testdir
try:
print json.dumps(result)
sys.exit(0)
+ if huntrleaks:
+ warm_caches()
+
good = []
bad = []
skipped = []
# Collect cyclic trash.
gc.collect()
+def warm_caches():
+ """Create explicitly internal singletons which are created on demand
+ to prevent false positive when hunting reference leaks."""
+ # char cache
+ for i in range(256):
+ chr(i)
+ # unicode cache
+ for i in range(256):
+ unichr(i)
+ # int cache
+ list(range(-5, 257))
+
def findtestdir(path=None):
return path or os.path.dirname(__file__) or os.curdir