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
bef55f9f6d
commit
3ff5315f95
1 changed files with 6 additions and 3 deletions
|
@ -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)
|
||||
|
||||
|
@ -604,4 +607,4 @@ class TestSecurityScanner(unittest.TestCase):
|
|||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
unittest.main()
|
||||
|
|
Reference in a new issue