Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Stop skipping ages as they change unit
getElementsByClassName returns a live collection, so an age moved to the next unit dropped out of it mid-loop and the age after it was skipped until the next pass, which can be a day away. On a cached page that has crossed a unit boundary every second age stayed stale. querySelectorAll returns a static list of the same elements.
Diffstat (limited to 'tests/t0005-markup.sh')
-rwxr-xr-xtests/t0005-markup.sh6
1 file changed, 6 insertions, 0 deletions
diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh
index 5fa866d..1a8c5f2 100755
--- a/tests/t0005-markup.sh
+++ b/tests/t0005-markup.sh
@@ -162,6 +162,12 @@ test_expect_success 'the script waits for the page instead of holding it up' '
grep "<script src=./cgit.js. defer></script>" tmp
'
+# A collection from getElementsByClassName is live, so an age the loop moves to
+# another unit drops out of it at once and the age after it is skipped.
+test_expect_success 'the script walks the ages from a list that holds still' '
+ ! grep "getElementsByClassName" "$TEST_OUTPUT_DIRECTORY/../assets/cgit.js"
+'
+
# The rest of the hooks need a tag, a symlink, a submodule, a trailer, a lone
# carriage return, clone urls, an empty repository and a second page of
# repositories, so they get a commit and a config of their own after the checks