diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2021-06-23 18:41:39 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2021-06-23 18:41:39 -0400 |
| commit | a443c1b2d6a646cf90a8afc193c07ed12a2bf045 (patch) | |
| tree | 8ca5a1464d0faf5b2ea2b0d5dc336d860f03da7e /src/test/isolation/specs/timeouts.spec | |
| parent | 2031e1668e5577e64cfed29da69a34903d5a5227 (diff) | |
| download | postgresql-a443c1b2d6a646cf90a8afc193c07ed12a2bf045.tar.gz | |
Allow non-quoted identifiers as isolation test session/step names.
For no obvious reason, isolationtester has always insisted that
session and step names be written with double quotes. This is
fairly tedious and does little for test readability, especially
since the names that people actually choose almost always look
like normal identifiers. Hence, let's tweak the lexer to allow
SQL-like identifiers not only double-quoted strings.
(They're SQL-like, not exactly SQL, because I didn't add any
case-folding logic. Also there's no provision for U&"..." names,
not that anyone's likely to care.)
There is one incompatibility introduced by this change: if you write
"foo""bar" with no space, that used to be taken as two identifiers,
but now it's just one identifier with an embedded quote mark.
I converted all the src/test/isolation/ specfiles to remove
unnecessary double quotes, but stopped there because my
eyes were glazing over already.
Like 741d7f104, back-patch to all supported branches, so that this
isn't a stumbling block for back-patching isolation test changes.
Discussion: https://postgr.es/m/759113.1623861959@sss.pgh.pa.us
Diffstat (limited to 'src/test/isolation/specs/timeouts.spec')
| -rw-r--r-- | src/test/isolation/specs/timeouts.spec | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/test/isolation/specs/timeouts.spec b/src/test/isolation/specs/timeouts.spec index e167e1885a..c747b4ae28 100644 --- a/src/test/isolation/specs/timeouts.spec +++ b/src/test/isolation/specs/timeouts.spec @@ -11,20 +11,20 @@ teardown DROP TABLE accounts; } -session "s1" +session s1 setup { BEGIN ISOLATION LEVEL READ COMMITTED; } -step "rdtbl" { SELECT * FROM accounts; } -step "wrtbl" { UPDATE accounts SET balance = balance + 100; } +step rdtbl { SELECT * FROM accounts; } +step wrtbl { UPDATE accounts SET balance = balance + 100; } teardown { ABORT; } -session "s2" +session s2 setup { BEGIN ISOLATION LEVEL READ COMMITTED; } -step "sto" { SET statement_timeout = '10ms'; } -step "lto" { SET lock_timeout = '10ms'; } -step "lsto" { SET lock_timeout = '10ms'; SET statement_timeout = '10s'; } -step "slto" { SET lock_timeout = '10s'; SET statement_timeout = '10ms'; } -step "locktbl" { LOCK TABLE accounts; } -step "update" { DELETE FROM accounts WHERE accountid = 'checking'; } +step sto { SET statement_timeout = '10ms'; } +step lto { SET lock_timeout = '10ms'; } +step lsto { SET lock_timeout = '10ms'; SET statement_timeout = '10s'; } +step slto { SET lock_timeout = '10s'; SET statement_timeout = '10ms'; } +step locktbl { LOCK TABLE accounts; } +step update { DELETE FROM accounts WHERE accountid = 'checking'; } teardown { ABORT; } # It's possible that the isolation tester will not observe the final @@ -32,18 +32,18 @@ teardown { ABORT; } # We can ensure consistent test output by marking those steps with (*). # statement timeout, table-level lock -permutation "rdtbl" "sto" "locktbl"(*) +permutation rdtbl sto locktbl(*) # lock timeout, table-level lock -permutation "rdtbl" "lto" "locktbl"(*) +permutation rdtbl lto locktbl(*) # lock timeout expires first, table-level lock -permutation "rdtbl" "lsto" "locktbl"(*) +permutation rdtbl lsto locktbl(*) # statement timeout expires first, table-level lock -permutation "rdtbl" "slto" "locktbl"(*) +permutation rdtbl slto locktbl(*) # statement timeout, row-level lock -permutation "wrtbl" "sto" "update"(*) +permutation wrtbl sto update(*) # lock timeout, row-level lock -permutation "wrtbl" "lto" "update"(*) +permutation wrtbl lto update(*) # lock timeout expires first, row-level lock -permutation "wrtbl" "lsto" "update"(*) +permutation wrtbl lsto update(*) # statement timeout expires first, row-level lock -permutation "wrtbl" "slto" "update"(*) +permutation wrtbl slto update(*) |
