mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
make test dvla response file timestamps in a random order
since there'll be a bunch of threads running functional test tasks at the same time, there's no point always trying to start from the same second and then stepping back to the same one-second-back file each time. Also, this leads us to an increased risk of race conditions. This change takes the same thirty second range, but shuffles it. The tests, since they're no longer deterministic, now use a new Matcher object (w/ credit to alexey) to match any filename from within that thirty second range
This commit is contained in:
@@ -162,3 +162,15 @@ def set_config_values(app, dict):
|
||||
finally:
|
||||
for key in dict:
|
||||
app.config[key] = old_values[key]
|
||||
|
||||
|
||||
class Matcher:
|
||||
def __init__(self, description, key):
|
||||
self.description = description
|
||||
self.key = key
|
||||
|
||||
def __eq__(self, other):
|
||||
return self.key(other)
|
||||
|
||||
def __repr__(self):
|
||||
return '<Matcher: {}>'.format(self.description)
|
||||
|
||||
Reference in New Issue
Block a user