neondatabase / neon

Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, code-like database branching, and scale to zero.
https://neon.tech
Apache License 2.0
13.2k stars 367 forks source link

tests: use semaphore instead of lock for Endpoint.running #8112

Closed jcsp closed 1 week ago

jcsp commented 1 week ago

Problem

Ahem, let's try this again.

https://github.com/neondatabase/neon/pull/8110 had a spooky failure in test_multi_attach where a call to Endpoint.stop() timed out waiting for a lock, even though we can see an earlier call completing and releasing the lock. I suspect something weird is going on with the way pytest runs tests across processes, or use of asyncio perhaps.

Anyway: the simplest fix is to just use a semaphore instead: if we don't lock we can't deadlock.

Summary of changes

Checklist before requesting a review

Checklist before merging

github-actions[bot] commented 1 week ago

3228 tests run: 3111 passed, 0 failed, 117 skipped (full report)


Flaky tests (1) #### Postgres 15 - `test_timeline_size_quota_on_startup`: [release](https://neon-github-public-dev.s3.amazonaws.com/reports/pr-8112/9583413584/index.html#suites/c39429f093f87547b2a3b0943e2522d9/e8b31b0f2f249715/retries)

Code coverage* (full report)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
8cc4c9d1bf9d0a56772f138cb31771b660fc619f at 2024-06-19T15:46:27.823Z :recycle: