test: negative pgrst_db_pool_available in metrics#4928
Conversation
04727cc to
7639520
Compare
|
@wolfgangwalther Compared to #4855, this test is to the point (shorter/passes coverage) and if #4868 will make it irrelevant it will be easy to delete later IMO. |
7639520 to
deccad7
Compare
Let's recap the problems I see with #4855 (including the two preliminary PRs introducing toxiproxy):
This PR tests the full executable and doesn't extend on the I will have to say, though, that using Now, you're essentially saying: In light of #4868 both of these approaches would be throw-away code and this one has less impact on testing infrastructure over all. I see that argument, yes, so I won't block on the addition. But I'll also have to say I can't happily approve such a hack either :) If this helps unblocking #4672, please go ahead. |
Proves the failure on PostgREST#4622. This doesn't require additional test infra, only nginx. Taking advantage of the `stream {}` context which is also compatible with unix socket besides TCP.
deccad7 to
3690c85
Compare
I'd argue Nginx is way underused as TCP/unix socket proxy, all the lua directives of openresty (e.g. But sure, this can be temporary/throwaway so #4672 is not merged without complying to our own rule here:
Can't approve my own PR (I remember I used to be able to do this 😮) so I'll have to request other reviews. |
You can just check the red box "Merge without waiting for requirements to be met". |
|
In https://github.com/PostgREST/postgrest/actions/runs/26001265044/job/76424775709?pr=4902, I get: Does that mean the test does not reliably reproduce the issue and accidentally passed in this case? |
|
Fixed on 8868d13. It just needed more sleep time, originally I put 4 seconds but I didn't want the test to take too long. We can also get rid of the sleep by using a
Well, that seems too harsh, it already passed multiple times and just failed once. It might be flaky but I wouldn't frame it as "accidentally". |
No, I mean it passed (instead of the expected fail) accidentally in my PR. |
Seems like it's not fixed, yet. I just got another "failure" (unexpected pass) looking the same in https://github.com/PostgREST/postgrest/actions/runs/26036288673/job/76535229229?pr=4935, which ran the most recent code. |
Depending on timing instead of waiting for some event to happen is bad, see #3424. So I'm much in favor of doing this properly. |
I don't wanna be that guy but... |
Solution was waiting for the liveness endpoint instead of readiness, did that on 1eba985 and 6220ab3, the sleep is gone. In hindsight I should have pushed those before merging #4672 so we can double check on CI, but I confirmed locally the test did failed fast. |
Proves the failure on #4622.
This doesn't require additional test infra, only nginx. Taking advantage of the
stream {}context which is also compatible with unix socket besides TCP.Same idea as in #4622 (comment) but using unix socket.