Skip to content

Conversation

@rene-oromtz
Copy link
Contributor

@rene-oromtz rene-oromtz commented Dec 19, 2025

Description

I've been noticing some RPI (muxpi device connector) provisioned successfully only to then proceed to the cleanup stage (skipping test and reserve phase). Since the status code (exit code) was not being sent at all to the server, my guess is that the code is breaking one step before during writing to serial endpoint.

testflinger-cli results 5f6dfae4-25e5-481f-8009-5f6ce4ae1223 | jq .provision_status
null

Note: sending all other the results and phases status codes succeeds, provisioning status code was never retrieved/send to server

Since muxpi device connector are writing serial data as binary, in case there is any invalid character attempted to be read as text will raise a UnicodeDecodeError.

This PR adds catching this exception and reading it properly before being sent to server.

Resolved issues

CERTTF-784

Documentation

Web service API changes

Tests

Added one unit test to validate this behavior. Tested the unit test locally with and without fix in place

Before fix:

...
>       (result, consumed) = self._buffer_decode(data, self.errors, final)
E       UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 8: invalid start byte

../../../../.local/share/uv/python/cpython-3.10.18-linux-x86_64-gnu/lib/python3.10/codecs.py:322: UnicodeDecodeError

@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.34%. Comparing base (e8f6add) to head (dc298cc).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #854      +/-   ##
==========================================
+ Coverage   71.31%   71.34%   +0.02%     
==========================================
  Files         108      108              
  Lines        9651     9659       +8     
  Branches      858      859       +1     
==========================================
+ Hits         6883     6891       +8     
  Misses       2595     2595              
  Partials      173      173              
Flag Coverage Δ *Carryforward flag
agent 73.03% <100.00%> (+0.17%) ⬆️
cli 87.78% <ø> (ø) Carriedforward from e8f6add
device 55.21% <ø> (ø) Carriedforward from e8f6add
server 87.71% <ø> (ø) Carriedforward from e8f6add

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
Agent 73.03% <100.00%> (+0.17%) ⬆️
CLI 87.78% <ø> (ø)
Common ∅ <ø> (∅)
Device Connectors 55.21% <ø> (ø)
Server 87.71% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rene-oromtz rene-oromtz requested a review from ajzobro December 19, 2025 17:49
assert len(requests) == 1
assert requests[0].json()["fragment_number"] == 0
assert requests[0].json()["phase"] == phase
assert requests[0].json()["log_data"] == "Boot OK\n\ufffd\ufffd\nDone"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\xff and \xfe both reduce to \ufffd?

Copy link
Contributor Author

@rene-oromtz rene-oromtz Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, both are replaced with U+FFFD � Replacement Character

@rene-oromtz
Copy link
Contributor Author

Closing as this was fixed in #856

@rene-oromtz rene-oromtz closed this Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants