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);