From 037845e50158d3ef9231cdb499b548c18dfb535e Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Wed, 25 Sep 2024 16:23:04 +0900 Subject: [PATCH] Sleep in test to ensure changed file timestamp --- src/test.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test.c b/src/test.c index 9c17dbe..8430b10 100644 --- a/src/test.c +++ b/src/test.c @@ -847,6 +847,11 @@ int main(void) { CHECK_TRUE(cache_file_size_0 == cache_file_size_1); // Change a file used by the template for PATH=/ . + // Sleep first since granularity is by the second. + puts("Sleeping for two seconds to ensure edited file's timestamp has " + "changed..."); + sleep(2); + puts("Done sleeping."); test_file = fopen(test_http_template_html_var_filename2, "w"); ASSERT_TRUE(test_file);