From 9edddfb39c28248389dacea8247cfbb79633dc45 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:17:02 -0700 Subject: 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. --- tests/t0005-markup.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') 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 "" 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 -- cgit