Commit 4d6abbe
committed
Reimplement driver tests for
I've gotten a failure a couple times in the driver tests for
`PGAdvisoryXactLock` in that it times out when trying to use another
transaction to acquire or release the lock:
--- FAIL: TestDriverDatabaseSQLLibPQ (19.44s)
driver_test.go:40: Generated schema "river_2025_05_08t01_05_22_schema_08" with migrations [1 2 3 4 5 6] on line "main" in 53.591381ms [9 generated] [5 reused]
driver_test.go:40: Driver does not support listener; skipping listener tests
--- FAIL: TestDriverDatabaseSQLLibPQ/PGAdvisoryXactLock (0.21s)
riverdrivertest.go:2691: TestTx using schema: river_2025_05_08t01_05_22_schema_06
riverdrivertest.go:2701: TestTx using schema: river_2025_05_08t01_05_22_schema_06
riverdrivertest.go:2727:
Error Trace: /home/runner/work/river/river/internal/riverinternaltest/riverdrivertest/riverdrivertest.go:2727
Error: Goroutine didn't finish in a timely manner
Test: TestDriverDatabaseSQLLibPQ/PGAdvisoryXactLock
riverdbtest.go:277: Checked in schema "river_2025_05_08t01_05_22_schema_08"; 1 idle schema(s) [137 generated] [133 reused]
FAIL
FAIL github.com/riverqueue/river 27.844s
Here, reimplement this test wholesale, moving away from dependency on
clock timing and over to having the other test transaction use the
non-blocking `pg_try_advisory_lock `instead. This should eliminate all
intermittency from this test case.
[1] https://github.com/riverqueue/river/actions/runs/14896356386/job/41839541488PGAdvisoryXactLock so they don't involve clock timing1 parent 4126c71 commit 4d6abbe
1 file changed
Lines changed: 32 additions & 31 deletions
Lines changed: 32 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
2703 | 2704 | | |
2704 | 2705 | | |
2705 | 2706 | | |
2706 | | - | |
2707 | | - | |
2708 | | - | |
2709 | | - | |
2710 | | - | |
2711 | | - | |
2712 | | - | |
2713 | | - | |
2714 | | - | |
2715 | | - | |
2716 | | - | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
2717 | 2722 | | |
2718 | | - | |
2719 | | - | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
2720 | 2727 | | |
2721 | | - | |
2722 | | - | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
2723 | 2731 | | |
2724 | | - | |
2725 | | - | |
2726 | | - | |
2727 | | - | |
| 2732 | + | |
| 2733 | + | |
2728 | 2734 | | |
2729 | | - | |
2730 | | - | |
2731 | | - | |
2732 | | - | |
2733 | | - | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
2734 | 2738 | | |
2735 | | - | |
| 2739 | + | |
| 2740 | + | |
2736 | 2741 | | |
2737 | | - | |
2738 | | - | |
2739 | | - | |
2740 | | - | |
2741 | | - | |
2742 | | - | |
| 2742 | + | |
| 2743 | + | |
2743 | 2744 | | |
2744 | 2745 | | |
2745 | 2746 | | |
| |||
0 commit comments