Cap test_log_generator_user_by_row to 100

For some datastores (for example postgreSQL), the guest-log scenario
test test_log_generator_user_by_row can take an inordinate amount of
time, since a lot of data is written into the user log once it is
enabled. This test should be capped so that an extremely large log file
won't cause the tests to time out.

Change-Id: Ie10c5cc4d5390013d111aef27991a747ac2ff795
Closes-Bug: #1559214
This commit is contained in:
Peter Stachowski
2016-03-18 16:32:36 +00:00
parent b3e3e61503
commit c72b2463a4

View File

@@ -560,6 +560,8 @@ class GuestLogRunner(TestRunner):
# Now get the full contents of the log
self.assert_log_generator(self.auth_client, log_name, lines=100000)
log_lines = len(self._get_last_log_contents(log_name).splitlines())
# cap at 100, so the test can't run away if something goes wrong
log_lines = min(log_lines, 100)
# Make sure we get the right number of log lines back each time
for lines in range(1, log_lines):
self.assert_log_generator(