Skip to content

Commit

Permalink
General test README cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoleman committed Jan 3, 2020
1 parent 1795eb2 commit 03cfb3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ See the [pg_partman.md file](doc/pg_partman.md) in the doc folder for full detai

TESTING
-------

This extension can use the pgTAP unit testing suite to evalutate if it is working properly (http://www.pgtap.org).
WARNING: You MUST increase max_locks_per_transaction above the default value of 64. For me, 128 has worked well so far. This is due to the sub-partitioning tests that create/destroy several hundred tables in a single transaction. If you don't do this, you risk a cluster crash when running subpartitioning tests.

See the [testing README](test/README_test.md) for more information.
8 changes: 7 additions & 1 deletion test/README_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ http://pgTAP.org/

A minimum version of pgtap 0.99.1 is required for pg_partman's test suite.

## General Setup

WARNING: You MUST increase `max_locks_per_transaction` above the default value of 64. For me, 128 has worked well so far. This is due to the sub-partitioning tests that create/destroy several hundred tables in a single transaction. If you don't do this, you risk a cluster crash when running subpartitioning tests.

Tests assume that the required extensions have been installed in the following schemas:

pg_partman: partman
Expand All @@ -20,7 +24,9 @@ Once that's done, it's best to use the **pg_prove** script that pgTAP comes with

pg_prove -ovf /path/to/partman/test/*.sql

For most tests, they must be run by a superuser since roles & schemas are created & dropped as part of the test. There is a separate test script for each of the partitioning types. The tests are not required to run pg_partman, so if you don't feel safe doing this you don't need to run the tests. But if you are running into problems and report any issues without a clear explanation of what is wrong, I will ask that you run the test suite so you can try and narrow down where the problem may be. You are free to look through to tests to see exactly what they're doing. All tests in the top level of the test folder are run inside a transaction that is rolled back, so they should not change anything (except jobmon logging as mentioned).
Most tests must be run by a superuser since roles & schemas are created & dropped as part of the test. There is a separate test script for each of the partitioning types. The tests are not required to run pg_partman, so if you don't feel safe doing this you don't need to run the tests. But if you are running into problems and report any issues without a clear explanation of what is wrong, I will ask that you run the test suite so you can try and narrow down where the problem may be. You are free to look through to tests to see exactly what they're doing. All tests in the top level of the test folder are run inside a transaction that is rolled back, so they should not change anything (except jobmon logging as mentioned).

## Specific Test Types

Tests for the time-custom partition type are in their own folder. The 30second test frequently errors out if run in certain 30 second blocks. Waiting for the next 30 second block and running it again should allow it to pass. Same goes for the 30 second test in the native folder.

Expand Down

0 comments on commit 03cfb3a

Please sign in to comment.