Stabilize git driver tests

These tests relied on sleeps which can cause races when running
the full test suite in parallel.  Instead, wait for the events
we know will happen to happen.

Also remove the dependency on yarl now that aiohttp has made a
release which works with yarl 1.0 (however, it does not work with
<1.0 which is why this needs to be combined with this change to
fix tests).

Change-Id: Ib1c626cdd3f083dd1d23a3c6547bd7163b66567e
This commit is contained in:
James E. Blair
2018-01-17 07:57:54 -08:00
parent 168a94117b
commit 185b970bad
3 changed files with 33 additions and 16 deletions

View File

@@ -38,6 +38,8 @@ class GitWatcher(threading.Thread):
self.poll_delay = poll_delay
self._stopped = False
self.projects_refs = self.git_connection.projects_refs
# This is used by the test framework
self._event_count = 0
def compareRefs(self, project, refs):
partial_events = []
@@ -112,6 +114,7 @@ class GitWatcher(threading.Thread):
self.git_connection.logEvent(event)
# Pass the event to the scheduler
self.git_connection.sched.addEvent(event)
self._event_count += 1
except Exception as e:
self.log.debug("Unexpected issue in _run loop: %s" % str(e))