Skip to content

Commit

Permalink
Chore: Improve test case timing
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Oct 14, 2023
1 parent 9e4d575 commit 60bfadd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/frigate/test_frigate.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_frigate_with_attachment(mosquitto, ntfy_service, caplog, capmqtt):
capmqtt.publish(topic="frigate/cam-testdrive/goat/snapshot", payload=payload_image)

# Make mqttwarn receive and process the message.
mqtt_process(mqttc, loops=6)
mqtt_process(mqttc, loops=8)

# Verify log output.
assert 'Successfully loaded service "ntfy"' in caplog.messages
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_frigate_with_notification(mosquitto, ntfy_service, caplog, capmqtt, jso
capmqtt.publish(topic="frigate/events", payload=payload_event)

# Make mqttwarn receive and process the message.
mqtt_process(mqttc, loops=3)
mqtt_process(mqttc, loops=6)

# Verify log output.
assert "MQTT message received: MqttMessage(topic='frigate/events'" in caplog.text
Expand Down Expand Up @@ -212,7 +212,7 @@ def test_frigate_without_notification(mosquitto, caplog, capmqtt, jsonfile):
capmqtt.publish(topic="frigate/events", payload=payload_event)

# Make mqttwarn receive and process the message.
mqtt_process(mqttc, loops=3)
mqtt_process(mqttc, loops=6)

# Verify log output.
assert "MQTT message received: MqttMessage(topic='frigate/events'" in caplog.text
Expand Down
4 changes: 2 additions & 2 deletions tests/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_system_dispatch_to_log_service_json(mosquitto, caplog, capmqtt):
capmqtt.publish(topic="test/log-1", payload=json.dumps({"name": "foo", "value": "bar"}))

# Make mqttwarn receive and process the message.
mqtt_process(mqttc, loops=3)
mqtt_process(mqttc, loops=4)

# Verify log output.
assert 'Successfully loaded service "log"' in caplog.messages
Expand Down Expand Up @@ -189,7 +189,7 @@ def test_system_dispatch_to_file_service_binary(mosquitto, caplog, capmqtt, pyte
capmqtt.publish(topic="test/file-1", payload=b"foobar")

# Make mqttwarn receive and process the message.
mqtt_process(mqttc, loops=3)
mqtt_process(mqttc, loops=4)

# Verify log output.
assert 'Successfully loaded service "log"' in caplog.messages
Expand Down

0 comments on commit 60bfadd

Please sign in to comment.