Skip to content

esp32: Cleanup and improvements to multi_espnow tests.#19194

Draft
projectgus wants to merge 4 commits into
micropython:masterfrom
projectgus:tests/espnow_cleanup
Draft

esp32: Cleanup and improvements to multi_espnow tests.#19194
projectgus wants to merge 4 commits into
micropython:masterfrom
projectgus:tests/espnow_cleanup

Conversation

@projectgus
Copy link
Copy Markdown
Contributor

Summary

While working on #16737 I noticed some issues with the multi_espnow tests, and some opportunity for small improvements. Submitted separately in this PR.

  • Improved logging of peer addresses.
  • Fixed a bug where the STA instance was left running at the end of the 75_rate.py test, meaning the data rate stayed locked to the value used in the test. If the other instance skipped this test then subsequent tests would fail.
  • Fixed a possible race condition setting up the asyncio test.
  • Explicitly skipped the channel test on ESP32C6 as it fails (see esp32/espnow: Add support for espnow v2.0. #16737 (comment)). I think this is an ESP-IDF bug (unconfirmed).

Testing

The multi_espnow tests don't currently pass in master if using ESP-IDF V5.4 or newer (because ESP-NOW V2 support is enabled by default). I've only tested these commits on top of the branch from #16737, and will mark as Draft until that PR is merged and can rebase this one.

  • Tested between an original ESP32 and an ESP32C6, and between original ESP32 and an ESP8266 board.
  • There are still some random failures running these tests (maybe 25% of runs get one random failure) which I think is due to ESP-NOW not doing reliable delivery. I also saw at least one time when ESP-NOW would stop working entirely until the board was hard reset. I suspect this may be a bug in the test where it leaves the STA Wi-Fi peripheral enabled through the entire run and therefore can get stuck in a weird state, rather than a bug in ESP-IDF or the ESP-NOW library. However I don't know.

Generative AI

I did not use generative AI tools when creating this PR.

projectgus added 4 commits May 7, 2026 17:50
This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Issue turned out to be something else, but I think there's still a
potential race here without this fix.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Was causing the next test to fail (maybe only when the other instance
skipped, not sure.)

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
Test always fails on this chip, looks like possibly an ESP-IDF v5.5.1 bug.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
@projectgus projectgus added port-esp32 tests Relates to tests/ directory in source labels May 7, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.46%. Comparing base (21b3a51) to head (2259ff2).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19194   +/-   ##
=======================================
  Coverage   98.46%   98.46%           
=======================================
  Files         176      176           
  Lines       22811    22811           
=======================================
  Hits        22460    22460           
  Misses        351      351           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

port-esp32 tests Relates to tests/ directory in source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant