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


[ROCm/rocm_smi_lib commit: 1c9ef44398]
Dieser Commit ist enthalten in:
Chris Freehill committed 2020-04-10 08:51:44 -05:00
1 Ursprung 01401b0caa
Commit 0759abca07
2 Dateien geändert
+8 -4

Keine Dateien entsprechen Ihrer Suche

@@ -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;
@@ -249,7 +249,6 @@ int main(int argc, char** argv) {
return 1;
}
int ret = 0;
sRSMIGlvalues = &settings;
return RUN_ALL_TESTS();
}