Skip to content

Commit 46174da

Browse files
committed
try to fix a flaky test
1 parent d2e13ef commit 46174da

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/test-ci/test-install.R

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
library(testit)
22

33
assert('normalize_repo() creates a valid url', {
4-
(normalize_repo('https://mirrors.mit.edu/CTAN/') %==%
5-
'https://mirrors.mit.edu/CTAN/systems/texlive/tlnet')
4+
u1 = 'https://mirrors.mit.edu/CTAN/'
5+
# for some reason, normalize_repo() may not always work on certain platforms on GHA
6+
for (i in 1:10) {
7+
u2 = normalize_repo(u1)
8+
if (u1 != u2) break else Sys.sleep(1)
9+
}
10+
(u2 %==% 'https://mirrors.mit.edu/CTAN/systems/texlive/tlnet')
611
(normalize_repo('https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2020/tlnet-final/') %==%
712
'https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/2020/tlnet-final')
813
})

0 commit comments

Comments
 (0)