official-stockfish / fishtest

The Stockfish testing framework
https://tests.stockfishchess.org/tests
281 stars 130 forks source link

wrong run_id for tests_view causes server internal error #1996

Closed peregrineshahin closed 6 months ago

peregrineshahin commented 6 months ago

This must be a newly introduced bug... because we fixed that before. some new code to get_run does not do error handling https://tests.stockfishchess.org/tests/view/testingWithDummyString

gives

Internal Server Error
The server encountered an unexpected internal server error
(generated by waitress)
ppigazzini commented 6 months ago

It is not an ObjectID, I am testing the fix on DEV. I wonder if this should be detected by the request validation.

ppigazzini commented 6 months ago

The api_schema seems to not check if run_id is compatible with ObjectID. Not a vtjson expert to know if that is possible.

https://github.com/official-stockfish/fishtest/blob/7209a4c940769023090f9b1c285397be73fd983f/server/fishtest/schemas.py#L12-L13

https://github.com/official-stockfish/fishtest/blob/7209a4c940769023090f9b1c285397be73fd983f/server/fishtest/schemas.py#L437-L457

https://github.com/official-stockfish/fishtest/blob/7209a4c940769023090f9b1c285397be73fd983f/server/fishtest/schemas.py#L505-L507