From f01897a80e86eeec54ee87c7a0603e7c24c4362b Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Wed, 18 Dec 2024 13:33:14 +0100 Subject: [PATCH] run transition in loop --- .github/workflows/test.yml | 2 +- internal/test/e2e/cluster_test.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 39a2618df..632d9aaec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,7 +83,7 @@ jobs: - name: Test uses: SiaFoundation/workflows/.github/actions/go-test@master with: - go-test-args: "-race;-timeout=20m;-tags=netgo,v2" + go-test-args: "-race;-timeout=20m;-tags=netgo,v2;-run=TestV1ToV2Transition;-count=50" test-mysql-v2: # Run all tests against MySQL needs: analyze diff --git a/internal/test/e2e/cluster_test.go b/internal/test/e2e/cluster_test.go index 0734a1cb4..16e48ea1e 100644 --- a/internal/test/e2e/cluster_test.go +++ b/internal/test/e2e/cluster_test.go @@ -3000,7 +3000,11 @@ func TestV1ToV2Transition(t *testing.T) { archivedContracts, err = cluster.Bus.Contracts(context.Background(), api.ContractsOpts{FilterMode: api.ContractFilterModeArchived}) tt.OK(err) if len(archivedContracts) != nHosts-1 { - return fmt.Errorf("expected %v archived contracts, got %v", nHosts-1, len(archivedContracts)) + var reasons []string + for _, c := range archivedContracts { + reasons = append(reasons, c.ArchivalReason) + } + return fmt.Errorf("expected %v archived contracts, got %v (reasons: %v)", nHosts-1, len(archivedContracts), reasons) } return nil }) @@ -3009,7 +3013,7 @@ func TestV1ToV2Transition(t *testing.T) { usedHosts := make(map[types.PublicKey]struct{}) for _, c := range archivedContracts { if c.ArchivalReason != "migrated to v2" { - t.Fatalf("expected archival reason to be 'migrated to v2', got %v", c.ArchivalReason) + t.Fatalf("expected archival reason to be 'migrated to v2', got '%v' (v2: %v)", c.ArchivalReason, c.V2) } usedHosts[c.HostKey] = struct{}{} }