Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consuming remaining output of the stockfish popen process #47

Open
johndoknjas opened this issue Jun 16, 2023 · 0 comments
Open

Consuming remaining output of the stockfish popen process #47

johndoknjas opened this issue Jun 16, 2023 · 0 comments

Comments

@johndoknjas
Copy link

johndoknjas commented Jun 16, 2023

After calling a function in models.py that uses self._read_line(), it'd be good if we could test that there's no remaining output left for the stockfish process. I've added a fixture in test_models.py that can be used to test the stockfish instance (after each test function finishes). So if there's a way to test that trying to call stockfish._read_line() will hang at that point (due to no output left over), that might be good.

Also, the current way we consume remaining output relies on having to know what the last line looks like (see self._discard_remaining_stdout_lines()). A more streamlined solution may be better. E.g., the top answer here could maybe be used, with a wait time of a millisecond?

@johndoknjas johndoknjas changed the title Test that the stockfish process doesn't have remaining output Consuming remaining output of the stockfish popen process Jul 18, 2023
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

No branches or pull requests

1 participant