mirror of
https://github.com/google/nomulus
synced 2026-09-26 09:54:28 +00:00
Drop postgresql schema instead of database in Sql tests (#530)
* Drop schema instead of database in Sql tests Speed up the database cleanup between tests by dropping the schema instead of the database. The new approach is much faster. Ad hoc measurement on my desktop shows that :core:sqlIntegrationTest improves from 73 seconds to 48 seconds, and :core:standardTest improves from 12m40 to 7m40.
This commit is contained in:
+5
-2
@@ -12,5 +12,8 @@
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
DROP DATABASE IF EXISTS postgres;
|
||||
CREATE DATABASE postgres;
|
||||
-- In Postgresql, recreating schema is faster than recreating the database.
|
||||
DROP SCHEMA public CASCADE;
|
||||
CREATE SCHEMA public;
|
||||
GRANT USAGE ON SCHEMA public to PUBLIC;
|
||||
GRANT CREATE ON SCHEMA public to PUBLIC;
|
||||
|
||||
Reference in New Issue
Block a user