postgrest
postgrest copied to clipboard
IO tests may hang writing to full stdout pipe
E.g., raising the post-signal sleep in test_admin_ready_includes_schema_cache_state from 0.1 to 2 causes the test to hang, because postgrest hangs writing to the stdout pipe, see #2389.
It's quite confusing when this happens, though I'm not sure it's worth fixing... Some potential solutions:
- create a stdout pipe with a larger buffer if possible, to make this less likely to happen
- buffer stdout in-memory, by having a thread continuously drain the pipe, and reading from that thread's buffer instead (this would be a nice solution if it's already packaged as an easily available python library)
- have postgrest log to a file on disk, and read from that file where we want to interact with the logs
have postgrest log to a file on disk, and read from that file where we want to interact with the logs
Logging to disk sounds good. I also had trouble before when interacting with stdout on the pytests.