Commit 7d9b3f5
committed
docs(test): explain why txdb can't seed shared state across subtests
Expand the comment on TestShell_BeforeNode and TestShell_RunNode_WithBeforeNode
to document *why* heavyweight.FullTestDBV2 is the right tool here, not txdb.
The subtests need to share a seeded encrypted key ring so the
incorrect_password case has something to fail decryption against
(keystore.Unlock on an empty keystore silently creates a new ring
with whatever password is supplied). Naively you would reach for
txdb, but chainlink-common/pkg/sqlutil/pg/pg.go:69 passes
uuid.New().String() as the DSN on every pg.NewConnection call —
deliberately, so each ORM gets its own transaction — which means
the seed connection and BeforeNode's LockedDB land on different
keys in the txdb driver's DSN-keyed conns map and get independent
transactions. Seed is invisible to BeforeNode. Same reason Erik's
PR #21504 newAppWithOpts + txdb override couldn't make incorrect_password
pass.
A real per-test physical DB via FullTestDBV2 gives cross-connection
visibility with its own t.Cleanup and without polluting the shared
chainlink_test DB. No functional change — just documents the trap
so the next person doesn't repeat the investigation.
Refs: CORE-23881 parent 221be77 commit 7d9b3f5
1 file changed
Lines changed: 29 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
521 | 537 | | |
522 | 538 | | |
523 | 539 | | |
| |||
595 | 611 | | |
596 | 612 | | |
597 | 613 | | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
602 | 618 | | |
603 | 619 | | |
604 | 620 | | |
| |||
0 commit comments