-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test where zesMemoryGetState & zesFirmwareGetProperties APIs are invoked in threads #81
base: master
Are you sure you want to change the base?
Conversation
…ed in parallel Related to VLCLJ-2289 Signed-off-by: Harini Kumaran <[email protected]>
conformance_tests/sysman/test_sysman_memory/src/test_sysman_memory.cpp
Outdated
Show resolved
Hide resolved
conformance_tests/sysman/test_sysman_memory/src/test_sysman_memory.cpp
Outdated
Show resolved
Hide resolved
std::thread firmwareThreads[numThreads]; | ||
|
||
for (int i = 0; i < numThreads; i++) { | ||
memoryThreads[i] = std::thread(getMemoryStateTemp, device); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AshwinKumarKulkarni is the test expected to have barrier mechanism in both the functions getMemoryState & getFirmwareProperties ? similar to test GivenValidMemoryAndRasHandlesWhenGettingMemoryGetStateAndRasGetStateFromDifferentThreadsThenExpectBothToReturnSucess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- move enumerateAPIs to thread body
- change get_prop_length ->get_property_length
- clean up functions, remove comments/prints
- use snake case in CTS to mantain uniformity
…ed in parallel Related to VLCLJ-2289 Signed-off-by: Harini Kumaran <[email protected]>
|
||
TEST_F( | ||
MEMORY_FIRMWARE_TEST, | ||
GivenValidMemoryAndFirmwareHandlesWhenGettingMemoryGetStateAndFirmwareGetPropertiesFromDifferentThreadsThenExpectBothToReturnSucess) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GivenValidDeviceWhenCallingMemoryGetStateAndFirmwareGetPropertiesFromDifferentThreadsThenSuccessIsReturned
@@ -23,12 +25,23 @@ std::mutex mem_mutex; | |||
std::condition_variable condition_variable; | |||
uint32_t ready = 0; | |||
|
|||
uint32_t get_property_length(char *prop) { return std::strlen(prop); } | |||
const uint32_t numThreads = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be moved inside the test, since only one test is using this ?
@@ -23,12 +25,23 @@ std::mutex mem_mutex; | |||
std::condition_variable condition_variable; | |||
uint32_t ready = 0; | |||
|
|||
uint32_t get_property_length(char *prop) { return std::strlen(prop); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if any other harness files contains this function , can it be reused ?
#ifdef USE_ZESINIT | ||
class MemoryModuleZesTest : public lzt::ZesSysmanCtsClass {}; | ||
#define MEMORY_TEST MemoryModuleZesTest | ||
|
||
class MemoryFirmwareZesTest : public lzt::ZesSysmanCtsClass {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess new fixture may not be required. already existing fixture can be used (MEMORY_TEST)
PR can be moved from draft to open state |
@@ -23,12 +25,23 @@ std::mutex mem_mutex; | |||
std::condition_variable condition_variable; | |||
uint32_t ready = 0; | |||
|
|||
uint32_t get_property_length(char *prop) { return std::strlen(prop); } | |||
const uint32_t numThreads = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to add this in Test code or create a environment variable to read this value for numThreads
Related to VLCLJ-2289