Skip to content

Speed up slow tests#2019

Merged
thomas-zahner merged 10 commits intolycheeverse:masterfrom
thomas-zahner:speed-up-slow-tests
Feb 9, 2026
Merged

Speed up slow tests#2019
thomas-zahner merged 10 commits intolycheeverse:masterfrom
thomas-zahner:speed-up-slow-tests

Conversation

@thomas-zahner
Copy link
Member

@thomas-zahner thomas-zahner commented Feb 1, 2026

Fix #1892.

In CI we can see that tests now take about 55 seconds instead of 70 seconds. The CI action spends a lot of time in compiling lychee. This change is mainly an improvement for local development. E.g. on my machine the first stage of make test (cargo nextest run --all-targets --all-features) now takes about 5 seconds instead of 12 on average.

Apart from speeding up the tests I could also improve the reliability.

Some background details

test_lycheecache_exclude_custom_status_codes requires no internet but was slow because of unnecessary retries.

test_require_https is using example.com. As it seems really unpractical to make localhost functional with HTTPS and it generally isn't slow I would prefer to keep this test unchanged.

Fix the flakiness of the cache tests. They were racing against each other writing and deleting the cache files of each other.

@thomas-zahner thomas-zahner force-pushed the speed-up-slow-tests branch 2 times, most recently from 6646340 to 521a8e0 Compare February 2, 2026 02:26
Copy link
Member

@katrinafyi katrinafyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. it's a very good idea to disentangle the cache tests.

Remove dependency on previously deleted TEST_INVALID_URLS.html
The test is now running locally without requiring an internet connection
The previous assertion conincidentially matched the timestamp 1769996167
@thomas-zahner thomas-zahner force-pushed the speed-up-slow-tests branch 2 times, most recently from 8fc4097 to 54d7e3b Compare February 9, 2026 13:53
thomas-zahner and others added 4 commits February 9, 2026 15:00
The test was previously lying and confusing.
Unknown status codes such as 999 are actually cached today.
linkedin returned 200 given lychee's user agent.
Co-authored-by: katrinafyi <39479354+katrinafyi@users.noreply.github.com>
@thomas-zahner thomas-zahner merged commit 9db63a7 into lycheeverse:master Feb 9, 2026
7 checks passed
@mre mre mentioned this pull request Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Speed up slow tests

3 participants