Files
libite/test/runbg.c
T
Joachim Wiberg 563b387ec7 test: increase delay waiting for background job in Debian container
GitHub action fails, probably due to too short wait delay.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-09-17 12:11:51 +02:00

24 lines
413 B
C

#include "check.h"
#define file "/tmp/runbg.txt"
int main(void)
{
char *cmd[] = {
"sh", "-c", "echo 'hello world' > " file, NULL
};
erase(file);
test(runbg(cmd, 200000), "Calling runbg");
if (test(fexist(file), "Verifying %s does not yet exist", file))
return 1;
test(usleep(500000), "Waiting for runbg");
if (test(!fexist(file), "Verifying %s has been created", file))
return 1;
return 0;
}