Commit 87e82c3
authored
`rivertest.Worker` works a job in three database steps: it inserts the job
through the client, builds an inline completer, and transitions the job to
`running` via `JobUpdateFull`. The first two already thread `config.Schema`
through — the client uses it internally, and it's passed explicitly to
`jobcompleter.NewInlineCompleter` — but the `JobUpdateFull` call omitted it.
With a non-default `Schema`, the insert lands the job in `<schema>.river_job`
correctly, then the running-state update runs unqualified and resolves only
through the connection's `search_path`. On a connection that doesn't include
the configured schema it fails one step later with:
test worker internal error: failed to update job to running state: ERROR: relation "river_job" does not exist (SQLSTATE 42P01)
Pass `w.config.Schema` into `JobUpdateFullParams` so all three steps agree on
the schema. This finishes custom-schema support for `rivertest.Worker`; the
`rivertest.Require*` family received an analogous per-call `Schema` option in
#926 (#907).
The regression tests migrate River into an isolated named schema and work jobs
through a transaction whose `search_path` is empty, so the tables resolve only
via schema qualification — the exact condition that fails before this change.
They live as `CustomSchema` subtests of `TestWorker_Work` and
`TestWorker_WorkJob`, each building its own bundle inline since the schema setup
differs from those tests' shared `setup`.
1 parent 61c6ac7 commit 87e82c3
3 files changed
Lines changed: 67 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
453 | 481 | | |
454 | 482 | | |
455 | 483 | | |
| |||
556 | 584 | | |
557 | 585 | | |
558 | 586 | | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
559 | 621 | | |
0 commit comments