Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

harinik124
Copy link
Contributor

Related to VLCLJ-2289

…ed in parallel

Related to VLCLJ-2289

Signed-off-by: Harini Kumaran <[email protected]>
std::thread firmwareThreads[numThreads];

for (int i = 0; i < numThreads; i++) {
memoryThreads[i] = std::thread(getMemoryStateTemp, device);
Copy link
Contributor

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

Copy link
Contributor

@AshwinKumarKulkarni AshwinKumarKulkarni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. move enumerateAPIs to thread body
  2. change get_prop_length ->get_property_length
  3. clean up functions, remove comments/prints
  4. 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) {
Copy link
Contributor

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;
Copy link
Contributor

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); }
Copy link
Contributor

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 {};
Copy link
Contributor

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)

@vishnu-khanth
Copy link
Contributor

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;
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants