~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

Speed up a slow memory-hungry test that doesn't need to be.
Rather than allocating a 26MB string, allocate a long list and call writelines.
Also, write 5MB rather tan 26MB, rollover is at 4MB anyway. (less I/O)

Show diffs side-by-side

added added

removed removed

Lines of Context:
272
272
    def test_log_rollover(self):
273
273
        temp_log_name = 'test-log'
274
274
        trace_file = open(temp_log_name, 'at')
275
 
        trace_file.write('test_log_rollover padding\n' * 1000000)
 
275
        trace_file.writelines(['test_log_rollover padding\n'] * 200000)
276
276
        trace_file.close()
277
277
        _rollover_trace_maybe(temp_log_name)
278
278
        # should have been rolled over