From 58af8aa73bb2b9b33365d07a82350907b6ef33f4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 25 Oct 2024 15:51:41 -0400 Subject: [PATCH] Try to fix random CI failures by using a random port in TestCommissioningWindowManager. --- src/app/tests/TestCommissioningWindowManager.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/tests/TestCommissioningWindowManager.cpp b/src/app/tests/TestCommissioningWindowManager.cpp index 5df7a4b6ce861d..297a95e299a30b 100644 --- a/src/app/tests/TestCommissioningWindowManager.cpp +++ b/src/app/tests/TestCommissioningWindowManager.cpp @@ -113,9 +113,8 @@ class TestCommissioningWindowManager : public ::testing::Test static chip::SimpleTestEventTriggerDelegate sSimpleTestEventTriggerDelegate; initParams.testEventTriggerDelegate = &sSimpleTestEventTriggerDelegate; (void) initParams.InitializeStaticResourcesBeforeServerInit(); - // Set a randomized server port(slightly shifted from CHIP_PORT) for testing - initParams.operationalServicePort = - static_cast(initParams.operationalServicePort + chip::Crypto::GetRandU16() % 20); + // Use whatever server port the kernel decides to give us. + initParams.operationalServicePort = 0; ASSERT_EQ(chip::Server::GetInstance().Init(initParams), CHIP_NO_ERROR);