Commit 55769490 authored by Kirill Smelkov's avatar Kirill Smelkov

test/gen_testdata: Start generating test files from clean empty state

Previsouly we were generating e.g. 1.fs starting over existing 1.fs and
due to that when FileStoraga was opening it, it was e.g. scanning
existing 1.fs.index, thus doing some time() calls and so when the
database was started to be generted the state of the timer was different
compared to the situation if the database did not existed before
gen_testdata.py run. In other words the result of gen_testdata.py run
was different for the cases when it run after `rm testdata/1*` and
without that rm.

-> Make gen_testdata result to be stable irregardless of the start state
when it runs by explicitly removing test databases fitst.

As diff to *.zpickledis.ok shows, resulting changes are only in
transaction IDs.
parent 395d8c27
......@@ -44,6 +44,8 @@ from ZODB.POSException import UndoError
from persistent import Persistent
import transaction
import os
import glob
import sys
import struct
import time
......@@ -285,6 +287,8 @@ def main():
dbname = out
if not zext:
dbname += "_!zext"
for f in glob.glob(dbname + '.*'):
os.remove(f)
gen_testdb("%s.fs" % dbname, zext=zext)
stor = FileStorage("%s.fs" % dbname, read_only=True)
for pretty in ('raw', 'zpickledis'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment