Add checking for no-longer-existing process in test

When getting process information for a process, it's possible
that between the time the process ID was discovered and when
we attempt to collect data for that process, that the process
ended. This change is meant to handle that in the test case.

* Also, fix compile warning by removing unused variable.

Change-Id: I62f9a84a63548c856f0661fef15b7d248a330c05
This commit is contained in:
Chris Freehill
2020-04-09 15:55:02 -05:00
parent f8b57c3b16
commit 1c9ef44398
2 changed files with 8 additions and 4 deletions
@@ -166,9 +166,14 @@ void TestProcInfoRead::Run(void) {
for (uint32_t j = 0; j < num_proc_found; j++) {
err = rsmi_compute_process_gpus_get(procs[j].process_id, dev_inds,
&amt_allocd);
CHK_ERR_ASRT(err)
ASSERT_LE(amt_allocd, num_devices);
if (err == RSMI_STATUS_NOT_FOUND) {
std::cout << "\t**Process " << procs[j].process_id <<
" is no longer present.";
continue;
} else {
CHK_ERR_ASRT(err);
ASSERT_LE(amt_allocd, num_devices);
}
std::cout << "\t**Process " << procs[j].process_id <<
" is using devices with indices: ";
uint32_t i;
-1
View File
@@ -249,7 +249,6 @@ int main(int argc, char** argv) {
return 1;
}
int ret = 0;
sRSMIGlvalues = &settings;
return RUN_ALL_TESTS();
}