borkdude / quickblog

Light-weight static blog engine for Clojure and babashka
https://blog.michielborkent.nl/
MIT License
165 stars 28 forks source link

Fix flaky tests #94

Closed jmglov closed 7 months ago

jmglov commented 7 months ago

Please answer the following questions and leave the below in as part of your PR.

borkdude commented 7 months ago

Can you explain the changes in this PR? Why is there a file removed from the function? Why is Thread/sleep added?

jmglov commented 7 months ago

The this-file thing never actually worked, so I removed it as extraneous.

The sleeps are there to ensure that on a fast machine, at least a millisecond will have passed since the last time a file was written so the last modified timestamp won't accidentally be the same. This is my theory for why these tests were flaky on CI but not on my laptop.

Sleeping 500 ms is probably excessive, but I just wanted to be safe. Should I dial that down to 5 ms or something?

borkdude commented 7 months ago

yeah, ok, let's do 5ms :)