Skip to content

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

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 ?

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 ?

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

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