Skip to content

Commit

Permalink
Fix core_count chaos mode test to reflect that rr with or without cha…
Browse files Browse the repository at this point in the history
…os mode always returns the true number of processors configured
  • Loading branch information
rocallahan committed Sep 19, 2024
1 parent ceeff12 commit daee39c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/chaos-test/core_count.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

int main(__attribute__((unused)) int argc, char** argv) {
int cores = atoi(argv[1]);
int sysconf_onln = sysconf(_SC_NPROCESSORS_ONLN);

if (sysconf(_SC_NPROCESSORS_ONLN) == cores &&
sysconf(_SC_NPROCESSORS_CONF) == cores) {
if (sysconf_onln == cores) {
caught_test_failure("got core count: %d", cores);
}

atomic_printf("Found %d cores online\n", sysconf_onln);
atomic_puts("EXIT-SUCCESS");
return 0;
}

0 comments on commit daee39c

Please sign in to comment.