|
20 | 20 |
|
21 | 21 | # Add command receiver for bootstrapping device registry / device for testing
|
22 | 22 | sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'mqtt_example')) # noqa
|
23 |
| -from flaky import flaky |
24 | 23 | from google.cloud import pubsub
|
25 | 24 | import pytest
|
26 | 25 |
|
|
33 | 32 | es_cert_path = 'resources/ec_public.pem'
|
34 | 33 | rsa_cert_path = 'resources/rsa_cert.pem'
|
35 | 34 | rsa_private_path = 'resources/rsa_private.pem' # Must match rsa_cert
|
36 |
| -topic_id = 'test-device-events-{}'.format(int(time.time())) |
| 35 | +topic_id = 'test-device-events-{}'.format(uuid.uuid4()) |
37 | 36 |
|
38 | 37 | project_id = os.environ['GCLOUD_PROJECT']
|
39 | 38 | service_account_json = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
|
@@ -202,6 +201,7 @@ def test_add_delete_unauth_device(test_topic, capsys):
|
202 | 201 | assert 'UNAUTH' in out
|
203 | 202 |
|
204 | 203 |
|
| 204 | +@pytest.mark.flaky(max_runs=5, min_passes=1) |
205 | 205 | def test_add_config_unauth_device(test_topic, capsys):
|
206 | 206 | device_id = device_id_template.format('UNAUTH')
|
207 | 207 | manager.open_registry(
|
@@ -363,7 +363,7 @@ def test_add_patch_delete_es256(test_topic, capsys):
|
363 | 363 | service_account_json, project_id, cloud_region, registry_id)
|
364 | 364 |
|
365 | 365 |
|
366 |
| -@flaky(max_runs=5, min_passes=1) |
| 366 | +@pytest.mark.flaky(max_runs=5, min_passes=1) |
367 | 367 | def test_send_command(test_topic, capsys):
|
368 | 368 | device_id = device_id_template.format('RSA256')
|
369 | 369 | manager.create_registry(
|
|
0 commit comments