Addresses comments around AZ_TRAIT_UNIT_TEST_NAME_COUNT from PR
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -194,9 +194,9 @@ namespace AZ
|
||||
return;
|
||||
}
|
||||
|
||||
Internal::NameData* nameData = dictIt->second; // restore the pointer in case the intrusive ptr was already assigned by other thread
|
||||
Internal::NameData* nameData = dictIt->second;
|
||||
|
||||
// Check m_hashCollision again inside the m_sharedMutex because a new collision could have happened
|
||||
// Check m_hashCollision inside the m_sharedMutex because a new collision could have happened
|
||||
// on another thread before taking the lock.
|
||||
if (nameData->m_hashCollision)
|
||||
{
|
||||
|
||||
@@ -604,9 +604,7 @@ namespace UnitTest
|
||||
AZ::NameDictionary::Create();
|
||||
|
||||
// 3 threads per name effectively makes two readers and one writer (the first to run will write in the dictionary)
|
||||
// Using AZ_TRAIT_UNIT_TEST_NAME_COUNT / 2 since the following line generates 3000 threads and that triggers ASan failures,
|
||||
// likely because of https://devblogs.microsoft.com/oldnewthing/20050729-14/?p=34773
|
||||
RunConcurrencyTest<ThreadCreatesOneName>(AZ_TRAIT_UNIT_TEST_NAME_COUNT / 2, 3);
|
||||
RunConcurrencyTest<ThreadCreatesOneName>(AZStd::thread::hardware_concurrency(), 3);
|
||||
}
|
||||
|
||||
TEST_F(NameTest, ConcurrencyDataTest_EachThreadCreatesOneName_HighCollisions)
|
||||
@@ -616,9 +614,7 @@ namespace UnitTest
|
||||
AZ::NameDictionary::Create();
|
||||
|
||||
// 3 threads per name effectively makes two readers and one writer (the first to run will write in the dictionary)
|
||||
// Using AZ_TRAIT_UNIT_TEST_NAME_COUNT / 2 since the following line generates 3000 threads and that triggers ASan failures,
|
||||
// likely because of https://devblogs.microsoft.com/oldnewthing/20050729-14/?p=34773
|
||||
RunConcurrencyTest<ThreadCreatesOneName>(AZ_TRAIT_UNIT_TEST_NAME_COUNT / 2, 3);
|
||||
RunConcurrencyTest<ThreadCreatesOneName>(AZStd::thread::hardware_concurrency() / 2, 3);
|
||||
}
|
||||
|
||||
TEST_F(NameTest, ConcurrencyDataTest_EachThreadRepeatedlyCreatesAndReleasesOneName_NoCollision)
|
||||
@@ -645,7 +641,7 @@ namespace UnitTest
|
||||
|
||||
TEST_F(NameTest, DISABLED_NameVsStringPerf_Creation)
|
||||
{
|
||||
constexpr int CreateCount = AZ_TRAIT_UNIT_TEST_NAME_COUNT;
|
||||
constexpr int CreateCount = 1000;
|
||||
|
||||
char buffer[RandomStringBufferSize];
|
||||
|
||||
@@ -654,7 +650,7 @@ namespace UnitTest
|
||||
AZStd::sys_time_t stringTime;
|
||||
|
||||
{
|
||||
const size_t dictionaryNoiseSize = AZ_TRAIT_UNIT_TEST_NAME_COUNT;
|
||||
const size_t dictionaryNoiseSize = 1000;
|
||||
|
||||
AZStd::vector<AZ::Name> existingNames;
|
||||
existingNames.reserve(dictionaryNoiseSize);
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define AZ_TRAIT_UNIT_TEST_ASSET_MANAGER_TEST_DEFAULT_TIMEOUT_SECS 5
|
||||
#define AZ_TRAIT_UNIT_TEST_ENTITY_ID_GEN_TEST_COUNT 10000
|
||||
#define AZ_TRAIT_UNIT_TEST_DILLER_TRIGGER_EVENT_COUNT 100000
|
||||
#define AZ_TRAIT_UNIT_TEST_NAME_COUNT 1000
|
||||
|
||||
#define AZ_TRAIT_TEST_APPEND_ROOT_FOLDER_TO_PATH true
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define AZ_TRAIT_UNIT_TEST_ASSET_MANAGER_TEST_DEFAULT_TIMEOUT_SECS 5
|
||||
#define AZ_TRAIT_UNIT_TEST_ENTITY_ID_GEN_TEST_COUNT 10000
|
||||
#define AZ_TRAIT_UNIT_TEST_DILLER_TRIGGER_EVENT_COUNT 100000
|
||||
#define AZ_TRAIT_UNIT_TEST_NAME_COUNT 1000
|
||||
|
||||
#define AZ_TRAIT_DISABLE_ALL_SAVE_DATA_TESTS true
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define AZ_TRAIT_UNIT_TEST_ASSET_MANAGER_TEST_DEFAULT_TIMEOUT_SECS 5
|
||||
#define AZ_TRAIT_UNIT_TEST_ENTITY_ID_GEN_TEST_COUNT 10000
|
||||
#define AZ_TRAIT_UNIT_TEST_DILLER_TRIGGER_EVENT_COUNT 100000
|
||||
#define AZ_TRAIT_UNIT_TEST_NAME_COUNT 1000
|
||||
|
||||
#define AZ_TRAIT_DISABLE_ASSET_JOB_PARALLEL_TESTS true
|
||||
#define AZ_TRAIT_DISABLE_ASSET_MANAGER_FLOOD_TEST true
|
||||
|
||||
@@ -13,4 +13,3 @@
|
||||
#define AZ_TRAIT_UNIT_TEST_ASSET_MANAGER_TEST_DEFAULT_TIMEOUT_SECS 5
|
||||
#define AZ_TRAIT_UNIT_TEST_ENTITY_ID_GEN_TEST_COUNT 10000
|
||||
#define AZ_TRAIT_UNIT_TEST_DILLER_TRIGGER_EVENT_COUNT 100000
|
||||
#define AZ_TRAIT_UNIT_TEST_NAME_COUNT 1000
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#define AZ_TRAIT_UNIT_TEST_ASSET_MANAGER_TEST_DEFAULT_TIMEOUT_SECS 5
|
||||
#define AZ_TRAIT_UNIT_TEST_ENTITY_ID_GEN_TEST_COUNT 10000
|
||||
#define AZ_TRAIT_UNIT_TEST_DILLER_TRIGGER_EVENT_COUNT 100000
|
||||
#define AZ_TRAIT_UNIT_TEST_NAME_COUNT 1000
|
||||
|
||||
#define AZ_TRAIT_DISABLE_ASSET_JOB_PARALLEL_TESTS true
|
||||
#define AZ_TRAIT_DISABLE_ASSET_MANAGER_FLOOD_TEST true
|
||||
|
||||
Reference in New Issue
Block a user