Skip to content

Commit

Permalink
run transition in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Dec 18, 2024
1 parent 176dcec commit f01897a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions internal/test/e2e/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand All @@ -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{}{}
}
Expand Down

0 comments on commit f01897a

Please sign in to comment.