Repository navigation
Closed
Description
Relates to: #1069
Implement after: #1146
Some tests produce errors in logs. There are expected errors:
cargo test -- --nocapture | grep "ERROR"We want to add assertions for them.
After merging this PR, we will be able to capture logs in tests.
This issue is better implemented after this one.
Subtasks
- Log assertions: add assertions for API log errors #1152
- Log assertions: add assertions for log errors in HTTP tracker #1162
- Log assertions: add assertions for log errors in UDP tracker #1164
Errors in test execution output
These are the three types of errors:
Tracker API:
The tracker API returns a 500 response on some endpoints, in spite of not being a server error.
2024-12-23T16:17:24.085791Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.097523Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.112349Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.134428Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.143296Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.157824Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.165816Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.183568Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.185476Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.187261Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.237987Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.245734Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.672115Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.683863Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.722476Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.726635Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.761522Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.764052Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.795266Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.859246Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.861906Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.885488Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:24.891247Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:25.013874Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:25.340567Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:25.405088Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:25.452089Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
2024-12-23T16:17:25.604966Z ERROR API: response failed classification=Status code: 500 Internal Server Error latency=0 ms
Whitelist:
2024-12-23T16:17:25.568154Z ERROR torrust_tracker::core: error=The torrent: 9c38422213e30bff212b30c360d26f9a02136422, is not whitelisted, src/core/mod.rs:1108:23
2024-12-23T16:17:25.630303Z ERROR torrust_tracker::core: error=The torrent: 9c38422213e30bff212b30c360d26f9a02136422, is not whitelisted, src/core/mod.rs:1108:23
UDP connection cookie:
2024-12-23T16:17:26.526503Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5264943
2024-12-23T16:17:26.526537Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5265365
2024-12-23T16:17:26.526556Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.526555
2024-12-23T16:17:26.526572Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5265718
2024-12-23T16:17:26.526588Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5265877
2024-12-23T16:17:26.526605Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5266044
2024-12-23T16:17:26.526620Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5266197
2024-12-23T16:17:26.526635Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5266347
2024-12-23T16:17:26.526652Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5266516
2024-12-23T16:17:26.526667Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5266664
2024-12-23T16:17:26.526683Z ERROR torrust_tracker::servers::udp::connection_cookie: error=cookie value is from future: 13655708322282452000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, expected < 1734970647.5266826
Activity
fix: missing logs for HTTP requests
josecelano commentedon Dec 23, 2024
You can run
cargo test -- --test-threads=1 --nocaptureto identify which tests are logging errors.And to run only one
cargo test -- --test-threads=1 --nocapture should_ban_the_client_ip_if_it_sends_more_than_10_requests_with_a_cookie_value_not_normal.josecelano commentedon Dec 23, 2024
Test producing errors in logs:
josecelano commentedon Dec 23, 2024
Updated list of tests producing errors in logs (22 in total):
API (19):
HTTP Tracker:
UDP Tracker:
cc @da2ce7
Merge #1153: Fix missing logs for HTTP requests
josecelano commentedon Dec 23, 2024
You can run a single test with:
josecelano commentedon Dec 26, 2024
All subtasks implemented.