]> git.seodisparate.com - c_simple_http/commitdiff
Sleep in test to ensure changed file timestamp
authorStephen Seo <seo.disparate@gmail.com>
Wed, 25 Sep 2024 07:23:04 +0000 (16:23 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Wed, 25 Sep 2024 07:23:04 +0000 (16:23 +0900)
src/test.c

index 9c17dbe06bbc7a43d9535faf7e6c304f36c8eec1..8430b109785b02495b57289fd2b39db5129ce5c8 100644 (file)
@@ -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);