Skip to content

Commit

Permalink
dltlyse: Update message payload pattern after python-dlt bb8f5b8
Browse files Browse the repository at this point in the history
  • Loading branch information
yen3 authored and aigarius committed Nov 23, 2022
1 parent de3f21e commit fdb9353
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion dltlyse/core/analyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@
]

# Traces to buffer since they might be stored before lifecycle start message
BUFFER_MATCHES_MSG = {"apid": "DA1", "ctid": "DC1", "payload_decoded": "[connection_info ok] connected \00\00\00\00"}
BUFFER_MATCHES_MSG = {
"apid": "DA1",
"ctid": "DC1",
# Note there is a trailing space at the end of the str. The reason is due to an
# optimization that compares (using `__eq__` aka `==`) the exact string that gets
# extracted by python-dlt now with stripped nul bytes (\00) that existed before.
"payload_decoded": "[connection_info ok] connected ",
}
BUFFER_MATCHES_ECUID = "XORA"
DLT_LIFECYCLE_START = {
"apid": "DLTD",
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/test_analyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def test_run_analyse_call_plugin_with_exception():
def test_run_analyse_buffer_traces():
"""Test to append traces to buffer"""
dlt_msgs = [
MockDLTMessage(apid="DA1", ctid="DC1", payload="[connection_info ok] connected \00\00\00\00"),
MockDLTMessage(apid="DA1", ctid="DC1", payload="[connection_info ok] connected "),
MockDLTMessage(ecuid="XORA"),
]

Expand Down

0 comments on commit fdb9353

Please sign in to comment.