test_secscan: add a second before reads from queue

Because of the granularity of MySQL's clock, we need to wait a second
before an item becomes available.
This commit is contained in:
Jimmy Zelinskie 2016-07-15 19:00:18 -04:00
parent bef55f9f6d
commit 3ff5315f95

View file

@ -1,6 +1,6 @@
import unittest
import json
import os
import time
import unittest
from httmock import urlmatch, all_requests, HTTMock
from app import app, config_provider, storage, notification_queue
@ -292,6 +292,7 @@ class TestSecurityScanner(unittest.TestCase):
self.assertAnalyzed(layer, True, 1)
# Ensure an event was written for the tag.
time.sleep(1)
queue_item = notification_queue.get()
self.assertIsNotNone(queue_item)
@ -453,6 +454,7 @@ class TestSecurityScanner(unittest.TestCase):
self.assertTrue(process_notification_data(notification_data))
# Ensure an event was written for the tag.
time.sleep(1)
queue_item = notification_queue.get()
self.assertIsNotNone(queue_item)
@ -524,6 +526,7 @@ class TestSecurityScanner(unittest.TestCase):
self.assertTrue(process_notification_data(notification_data))
# Ensure an event was written for the tag.
time.sleep(1)
queue_item = notification_queue.get()
self.assertIsNotNone(queue_item)