From 2ec6f96f9fa4a4b18be7c044d2a771d213c85141 Mon Sep 17 00:00:00 2001 From: "hrushikesh.bhosale" Date: Mon, 13 Apr 2026 15:20:30 +0530 Subject: [PATCH] fix(examples): make https_request rom_impl test resilient to transient external server errors The test_examples_protocol_https_request_rom_impl test on ESP32-C2 with the ROM mbedTLS implementation hits a public TLS endpoint (tls13.browserleaks.com / www.howsmyssl.com) for five sequential sub-tests. CI runs frequently fail mid-test with one of: * mbedtls_ssl_handshake returned -0x7780 (MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE - server-side fatal alert) * esp-tls: [sock=NN] select() timeout * esp-tls: Failed to open new connection in specified timeout In a representative log the first three sub-tests succeed and only the fourth/fifth fail, which is consistent with rate-limiting or transient server unavailability rather than a device bug. Mark the test as flaky with up to two reruns (10 s delay) so a single transient remote failure does not fail the CI job. Also align this test with the rest of the file by injecting the host timestamp via NVS (write_time_to_nvs) so the device clock no longer depends on a previous boot's persisted SNTP result, removing one more source of CI flakiness on first-boot or after NVS erase. --- examples/protocols/https_request/pytest_https_request.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/protocols/https_request/pytest_https_request.py b/examples/protocols/https_request/pytest_https_request.py index c4dfc54132..6906189896 100644 --- a/examples/protocols/https_request/pytest_https_request.py +++ b/examples/protocols/https_request/pytest_https_request.py @@ -390,6 +390,7 @@ def test_examples_protocol_https_request(dut: Dut) -> None: @pytest.mark.wifi_ap @pytest.mark.xtal_26mhz +@pytest.mark.flaky(reruns=2, reruns_delay=10) @pytest.mark.parametrize( 'config, baud', [ @@ -399,6 +400,7 @@ def test_examples_protocol_https_request(dut: Dut) -> None: ) @idf_parametrize('target', ['esp32c2'], indirect=['target']) def test_examples_protocol_https_request_rom_impl(dut: Dut) -> None: + write_time_to_nvs(dut) # Connect to AP if dut.app.sdkconfig.get('EXAMPLE_WIFI_SSID_PWD_FROM_STDIN') is True: dut.expect('Please input ssid password:')