Skip to content

Commit

Permalink
[all-clusters-app] Allow more subscriptions opened at the same time (…
Browse files Browse the repository at this point in the history
…second attempts) (#15168)
  • Loading branch information
vivien-apple authored and pull[bot] committed Aug 24, 2023
1 parent 5b18cc1 commit f39eb5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
4 changes: 2 additions & 2 deletions config/standalone/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
// Default of 8 ECs is not sufficient for some of the unit tests
// that try to validate multiple simultaneous interactions.
//
#define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS 16
#define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS 24

#define CHIP_IM_MAX_NUM_READ_HANDLER 5
#define CHIP_IM_MAX_NUM_READ_HANDLER 8

#define CONFIG_IM_BUILD_FOR_UNIT_TEST 1

Expand Down
27 changes: 6 additions & 21 deletions src/controller/tests/data_model/TestRead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ void TestReadInteraction::TestReadAttributeTimeout(nlTestSuite * apSuite, void *

NL_TEST_ASSERT(apSuite, !onSuccessCbInvoked && onFailureCbInvoked);

//
// TODO: Figure out why I cannot enable this line below.
//
// NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 1);
NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 1);

ctx.DrainAndServiceIO();
app::InteractionModelEngine::GetInstance()->GetReportingEngine().Run();
Expand Down Expand Up @@ -434,10 +431,7 @@ void TestReadInteraction::TestReadHandler_MultipleSubscriptions(nlTestSuite * ap

app::InteractionModelEngine::GetInstance()->ShutdownActiveReads();

//
// TODO: Figure out why I cannot enable this line below.
//
// NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
}

void TestReadInteraction::TestReadHandler_MultipleSubscriptionsWithDataVersionFilter(nlTestSuite * apSuite, void * apContext)
Expand Down Expand Up @@ -498,10 +492,7 @@ void TestReadInteraction::TestReadHandler_MultipleSubscriptionsWithDataVersionFi

app::InteractionModelEngine::GetInstance()->ShutdownActiveReads();

//
// TODO: Figure out why I cannot enable this line below.
//
// NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
}

void TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleSubscriptions(nlTestSuite * apSuite, void * apContext)
Expand Down Expand Up @@ -565,10 +556,7 @@ void TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleSubscription
app::InteractionModelEngine::GetInstance()->SetHandlerCapacity(-1);
app::InteractionModelEngine::GetInstance()->ShutdownActiveReads();

//
// TODO: Figure out why I cannot enable this line below.
//
// NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
}

void TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleReads(nlTestSuite * apSuite, void * apContext)
Expand Down Expand Up @@ -618,10 +606,7 @@ void TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleReads(nlTest
NL_TEST_ASSERT(apSuite, numSuccessCalls == 0);
NL_TEST_ASSERT(apSuite, numFailureCalls == 1);

//
// TODO: Figure out why I cannot enable this line below.
//
// NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0);
}

void TestReadInteraction::TestReadFabricScopedWithoutFabricFilter(nlTestSuite * apSuite, void * apContext)
Expand Down Expand Up @@ -740,11 +725,11 @@ const nlTest sTests[] =
NL_TEST_DEF("TestReadAttributeError", TestReadInteraction::TestReadAttributeError),
NL_TEST_DEF("TestReadFabricScopedWithoutFabricFilter", TestReadInteraction::TestReadFabricScopedWithoutFabricFilter),
NL_TEST_DEF("TestReadFabricScopedWithFabricFilter", TestReadInteraction::TestReadFabricScopedWithFabricFilter),
NL_TEST_DEF("TestReadAttributeTimeout", TestReadInteraction::TestReadAttributeTimeout),
NL_TEST_DEF("TestReadHandler_MultipleSubscriptions", TestReadInteraction::TestReadHandler_MultipleSubscriptions),
NL_TEST_DEF("TestReadHandler_MultipleSubscriptionsWithDataVersionFilter", TestReadInteraction::TestReadHandler_MultipleSubscriptionsWithDataVersionFilter),
NL_TEST_DEF("TestReadHandlerResourceExhaustion_MultipleSubscriptions", TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleSubscriptions),
NL_TEST_DEF("TestReadHandlerResourceExhaustion_MultipleReads", TestReadInteraction::TestReadHandlerResourceExhaustion_MultipleReads),
NL_TEST_DEF("TestReadAttributeTimeout", TestReadInteraction::TestReadAttributeTimeout),
NL_TEST_SENTINEL()
};
// clang-format on
Expand Down

0 comments on commit f39eb5a

Please sign in to comment.