mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-30 14:56:19 +00:00
## What changed? Adds TestPGXSimpleProtocol — a new entry in the persistence integration suite that runs `PostgreSQLSuite` under the `postgres12_pgx` plugin with `default_query_exec_mode=simple_protocol`. ## Why? Regression coverage for issues like [#9804](https://github.com/temporalio/temporal/issues/9804). With pgx ≤ v5.9.1, current_executions.state/status (proto-enum-typed int32 fields with a String() method) were text-encoded via fmt.Stringer and rejected by `Postgres` on simple/exec protocol, the path users land on behind PgBouncer in transaction pooling. pgx v5.9.2 fixed it upstream; this test makes sure we notice if pgx is ever downgraded or if a similar issue sneaks in. ## How did you test it? - [X] built - [X] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [X] added new functional test(s) Verified locally: passes on pgx v5.9.2; fails reproducibly on v5.9.1 with invalid input syntax for type integer: "Created" matching [#9804](https://github.com/temporalio/temporal/issues/9804). ## Potential risks Adds one additional pass through PostgreSQLSuite to the Integration test job. Job timeout is 15 min, so should be fine, but worth observing.
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package persistencetest_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"go.temporal.io/server/common/persistence"
|
|
"go.temporal.io/server/common/persistence/persistencetest"
|
|
"go.temporal.io/server/service/history/tasks"
|
|
)
|
|
|
|
func TestGetQueueKey_Default(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
queueKey := persistencetest.GetQueueKey(t)
|
|
require.Equal(t, persistence.QueueTypeHistoryNormal, queueKey.QueueType)
|
|
require.Equal(t, tasks.CategoryTransfer, queueKey.Category)
|
|
require.Equal(t, "src-TestGetQueueKey_Default", queueKey.SourceCluster)
|
|
require.Equal(t, "tgt-TestGetQueueKey_Default", queueKey.TargetCluster)
|
|
}
|
|
|
|
func TestGetQueueKey_WithOptions(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
queueKey := persistencetest.GetQueueKey(t,
|
|
persistencetest.WithQueueType(persistence.QueueTypeHistoryDLQ),
|
|
persistencetest.WithCategory(tasks.CategoryTimer),
|
|
)
|
|
require.Equal(t, persistence.QueueTypeHistoryDLQ, queueKey.QueueType)
|
|
require.Equal(t, tasks.CategoryTimer, queueKey.Category)
|
|
require.Equal(t, "src-TestGetQueueKey_WithOptions", queueKey.SourceCluster)
|
|
require.Equal(t, "tgt-TestGetQueueKey_WithOptions", queueKey.TargetCluster)
|
|
}
|