diff --git a/azext_iot/tests/test_iot_central_int.py b/azext_iot/tests/test_iot_central_int.py index 6f17cd28f..335af0eee 100644 --- a/azext_iot/tests/test_iot_central_int.py +++ b/azext_iot/tests/test_iot_central_int.py @@ -103,6 +103,8 @@ def test_central_monitor_events_deprecated(self): device_client = helpers.dps_connect_device(device_id, credentials) + enqueued_time = utility.calculate_millisec_since_unix_epoch_utc() - 10000 + payload = {"Bool": True} msg = Message( data=json.dumps(payload), @@ -111,8 +113,6 @@ def test_central_monitor_events_deprecated(self): ) device_client.send_message(msg) - enqueued_time = utility.calculate_millisec_since_unix_epoch_utc() - 10000 - # Test with invalid app-id self.cmd( "iot central app monitor-events --app-id {} -y".format(APP_ID + "zzz"), @@ -134,6 +134,8 @@ def test_central_monitor_events(self): device_client = helpers.dps_connect_device(device_id, credentials) + enqueued_time = utility.calculate_millisec_since_unix_epoch_utc() - 10000 + payload = {"Bool": True} msg = Message( data=json.dumps(payload), @@ -142,8 +144,6 @@ def test_central_monitor_events(self): ) device_client.send_message(msg) - enqueued_time = utility.calculate_millisec_since_unix_epoch_utc() - 10000 - # Test with invalid app-id self.cmd( "iot central diagnostics monitor-events --app-id {} -y".format(