Skip to content

Commit

Permalink
test: Skip environment-sensitive tests, unless "CI" is set
Browse files Browse the repository at this point in the history
Signed-off-by: Free Ekanayaka <[email protected]>
  • Loading branch information
freeekanayaka committed Jun 24, 2024
1 parent e104569 commit f63c3a1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/lib/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ int AioFill(aio_context_t *ctx, unsigned n)
int limit;
int used;

/* Only run these tests if the "CI" variable is set (GitHub runners do set
* it). This avoids spurious failures when running the tests in environments
* that are not isolated enough, and that might run other workflows using
* the AIO kernel sub-system. */
if (getenv("CI") == NULL) {
return -1;
}

/* Figure out how many events are available. */
fd = open("/proc/sys/fs/aio-max-nr", O_RDONLY);
munit_assert_int(fd, !=, -1);
Expand Down

0 comments on commit f63c3a1

Please sign in to comment.