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:
parent
9f6b47ad1f
commit
2ed5723ca9
1 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
import unittest
|
|
||||||
import json
|
import json
|
||||||
|
import time
|
||||||
|
import unittest
|
||||||
from httmock import urlmatch, all_requests, HTTMock
|
from httmock import urlmatch, all_requests, HTTMock
|
||||||
|
|
||||||
from app import app, storage, notification_queue
|
from app import app, storage, notification_queue
|
||||||
|
@ -290,6 +291,7 @@ class TestSecurityScanner(unittest.TestCase):
|
||||||
self.assertAnalyzed(layer, True, 1)
|
self.assertAnalyzed(layer, True, 1)
|
||||||
|
|
||||||
# Ensure an event was written for the tag.
|
# Ensure an event was written for the tag.
|
||||||
|
time.sleep(1)
|
||||||
queue_item = notification_queue.get()
|
queue_item = notification_queue.get()
|
||||||
self.assertIsNotNone(queue_item)
|
self.assertIsNotNone(queue_item)
|
||||||
|
|
||||||
|
@ -451,6 +453,7 @@ class TestSecurityScanner(unittest.TestCase):
|
||||||
self.assertTrue(process_notification_data(notification_data))
|
self.assertTrue(process_notification_data(notification_data))
|
||||||
|
|
||||||
# Ensure an event was written for the tag.
|
# Ensure an event was written for the tag.
|
||||||
|
time.sleep(1)
|
||||||
queue_item = notification_queue.get()
|
queue_item = notification_queue.get()
|
||||||
self.assertIsNotNone(queue_item)
|
self.assertIsNotNone(queue_item)
|
||||||
|
|
||||||
|
@ -522,6 +525,7 @@ class TestSecurityScanner(unittest.TestCase):
|
||||||
self.assertTrue(process_notification_data(notification_data))
|
self.assertTrue(process_notification_data(notification_data))
|
||||||
|
|
||||||
# Ensure an event was written for the tag.
|
# Ensure an event was written for the tag.
|
||||||
|
time.sleep(1)
|
||||||
queue_item = notification_queue.get()
|
queue_item = notification_queue.get()
|
||||||
self.assertIsNotNone(queue_item)
|
self.assertIsNotNone(queue_item)
|
||||||
|
|
||||||
|
|
Reference in a new issue