velxio/test/pi3_protocols
davidmonterocrespo24 ebace63ae5 fix(test): pi3 bme280 attach test sys.path + block-read race
Two small fixes after running the test inside the prod container for
the first time:

- The prod image lays out the backend at /app/app/, not /app/backend/app/
  (the Dockerfile.standalone COPYs only the inner package). Use /app
  as the sys.path root so `from app.pro.services import ...` resolves.
- The CHIP=0x60 and BLOCK= prints race against the socket drain. The
  test was treating "saw CHIP= but BLOCK= not in buffer yet" as a
  hard failure and exiting before the second I2C read finished.
  Gate the success path on both markers present and keep polling
  otherwise.

Verified end-to-end in the prod container:

    [proto] >>> ['I2C', '1', '76', 'RR', 'd0', '1']
    [proto] <<< I2C_DATA 1 76 60
    [proto] >>> ['I2C', '1', '76', 'RR', 'f7', '8']
    [proto] <<< I2C_DATA 1 76 530280155e607b50
    [test] OK — guest read chip ID = 0x60
    [test] OK — block read BLOCK=530280155e607b50

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 20:39:12 +02:00
..
test_pi3_bme280_attach.py fix(test): pi3 bme280 attach test sys.path + block-read race 2026-05-18 20:39:12 +02:00
test_pi3_protocols.py