#2136·neon

Prepare a database for remote_cluster tests

Author: bayandinCreated Jul 21, 2022Updated Aug 4, 2026
Labelsa/test

For remote_cluster marked tests, we use a preexisting database that we don't prepare before tests. And sometimes it fails to create a table with the same name. See https://github.com/neondatabase/neon/pull/2135 and https://github.com/neondatabase/neon/pull/2037/commits/1beba0d4c4d89d836341eeac9686a17fb63d5c18.

I see several ways to improve it:

  • Do not use preexisting db. Create a new project for each test. Also, this will allow running several remote_cluster builds in parallel (currently, they're limited by using only one GitHub runner). The proper solution, but it requires some API.
  • Create tables with random names. But anyway, we'll need to clean them up at some point.
  • Add a remove_cluster fixture which will cleanup (delete all tables) before/after the test.