Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/horizon/internal/integration: Add load test which generates ledgers loaded with soroban Tx Meta #5556

Merged
merged 16 commits into from
Jan 8, 2025
Merged
4 changes: 2 additions & 2 deletions ingest/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (c Change) String() string {
)
}

func (c Change) ledgerKey() (xdr.LedgerKey, error) {
func (c Change) LedgerKey() (xdr.LedgerKey, error) {
if c.Pre != nil {
return c.Pre.LedgerKey()
}
Expand Down Expand Up @@ -182,7 +182,7 @@ type sortableChanges struct {
func newSortableChanges(changes []Change) sortableChanges {
ledgerKeys := make([][]byte, len(changes))
for i, c := range changes {
lk, err := c.ledgerKey()
lk, err := c.LedgerKey()
if err != nil {
panic(err)
}
Expand Down
19 changes: 0 additions & 19 deletions services/horizon/docker/captive-core-integration-tests.cfg

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

29 changes: 16 additions & 13 deletions services/horizon/docker/docker-compose.integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
version: '3'
services:
core-postgres:
image: postgres:9.6.17-alpine
restart: on-failure
environment:
- POSTGRES_PASSWORD=mysecretpassword
- POSTGRES_DB=stellar
ports:
- "5641:5641"
command: ["-p", "5641"]
core:
platform: linux/amd64
# Note: Please keep the image pinned to an immutable tag matching the Captive Core version.
# This avoid implicit updates which break compatibility between
# the Core container and captive core.
image: ${CORE_IMAGE:-stellar/stellar-core:19.13.1-1481.3acf6dd26.focal}

depends_on:
- core-postgres
restart: on-failure
environment:
- TRACY_NO_INVARIANT_CHECK=1
Expand All @@ -29,5 +17,20 @@ services:
entrypoint: /usr/bin/env
command: /start standalone
volumes:
- ./${CORE_CONFIG_FILE:-stellar-core-integration-tests.cfg}:/stellar-core.cfg
- ${CORE_CONFIG_FILE}:/stellar-core.cfg
- ./core-start.sh:/start
soroban-rpc:
tamirms marked this conversation as resolved.
Show resolved Hide resolved
platform: linux/amd64
image: ${SOROBAN_RPC_IMAGE:-stellar/soroban-rpc}
restart: on-failure
ports:
- "8080:8080"
environment:
- ENDPOINT=:8080
- NETWORK_PASSPHRASE=Standalone Network ; February 2017
- CAPTIVE_CORE_CONFIG_PATH=/captive-core.cfg
- HISTORY_ARCHIVE_URLS=http://core:1570
- CHECKPOINT_FREQUENCY=8
- LOG_LEVEL=debug
volumes:
- ${CAPTIVE_CORE_CONFIG_FILE}:/captive-core.cfg
25 changes: 0 additions & 25 deletions services/horizon/docker/stellar-core-classic-integration-tests.cfg

This file was deleted.

30 changes: 0 additions & 30 deletions services/horizon/docker/stellar-core-integration-tests.cfg

This file was deleted.

16 changes: 9 additions & 7 deletions services/horizon/internal/integration/change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ package integration

import (
"context"
"io"
"sort"
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/stellar/go/ingest"
"github.com/stellar/go/ingest/ledgerbackend"
"github.com/stellar/go/keypair"
"github.com/stellar/go/services/horizon/internal/test/integration"
"github.com/stellar/go/txnbuild"
"github.com/stellar/go/xdr"
"github.com/stretchr/testify/assert"
"io"
"sort"
"testing"
"time"
)

func TestProtocolUpgradeChanges(t *testing.T) {
tt := assert.New(t)
itest := integration.NewTest(t, integration.Config{SkipHorizonStart: true})

upgradedLedgerAppx, _ := itest.GetUpgradedLedgerSeqAppx()
waitForLedgerInArchive(t, 15*time.Second, upgradedLedgerAppx)
waitForLedgerInArchive(t, 6*time.Minute, upgradedLedgerAppx)

ledgerSeqToLedgers := getLedgers(itest, 2, upgradedLedgerAppx)

Expand Down Expand Up @@ -61,7 +63,7 @@ func TestOneTxOneOperationChanges(t *testing.T) {
tt.NoError(err)

ledgerSeq := uint32(txResp.Ledger)
waitForLedgerInArchive(t, 15*time.Second, ledgerSeq)
waitForLedgerInArchive(t, 6*time.Minute, ledgerSeq)

ledger := getLedgers(itest, ledgerSeq, ledgerSeq)[ledgerSeq]
changes := getChangesFromLedger(itest, ledger)
Expand Down
Loading
Loading