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 ab343c5
Show file tree
Hide file tree
Showing 3 changed files with 13 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
1 change: 1 addition & 0 deletions autopilot/contractor/hostfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func (c *Contractor) isUsableContract(cfg api.AutopilotConfig, contract contract
usable = usable && !secondHalf // only unusable if in second half of renew window
refresh = false
renew = true
fmt.Println("renew", shouldRenew, secondHalf, contract.EndHeight(), cfg.Contracts.RenewWindow, bh)
}
}
return
Expand Down
13 changes: 11 additions & 2 deletions internal/test/e2e/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2987,6 +2987,7 @@ func TestV1ToV2Transition(t *testing.T) {

// mine until we reach the v2 allowheight
cluster.MineBlocks(network.HardforkV2.AllowHeight - cm.Tip().Height)
fmt.Println("allow", network.HardforkV2.AllowHeight-cm.Tip().Height)

// slowly mine a few more blocks to allow renter to react
for i := 0; i < 5; i++ {
Expand All @@ -3000,16 +3001,24 @@ 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)
}
for _, c := range archivedContracts {
fmt.Println("c1", c.ID, c.StartHeight, c.ProofHeight, c.EndHeight())
}

return nil
})

// they should be on nHosts-1 unique hosts
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)

Check failure on line 3021 in internal/test/e2e/cluster_test.go

View workflow job for this annotation

GitHub Actions / test-sqlite-v2 (1.22)

Test go.sia.tech/renterd/internal/test/e2e/TestV1ToV2Transition failed in 12.78s

cluster_test.go:3021: expected archival reason to be 'migrated to v2', got 'renewed' (v2: true) allow 0 c1 fb2d6cedc992e4f43c6c39e2650444b8991177d7ae59e3fd3e55ff17cd8643eb 18 0 199 c1 af2d820581e726d39785cf45379de612b3196f7fc8ad79747cda39bea1ac1dad 18 0 199 --- PASS: TestV1ToV2Transition (10.38s) allow 0 c1 a6d4d89716b158a63eb12ea75787909fb4688cc912e598ac577ad67031bf3b6f 18 0 199 c1 9bd52eb3e80ebb53929d8288af024b08869eb15916c56e10ca3d8940901b531b 18 0 199 --- PASS: TestV1ToV2Transition (12.09s) allow 0 c1 cef950badb949c7f0037639bd1e5ff100615ec4e72df41a4599af5c9f8583769 18 0 199 c1 4d77dc90c463e947c631bded88f54cd4f789a2cff21e6cb135abf1463954d31c 18 0 199 --- PASS: TestV1ToV2Transition (11.48s) allow 0 c1 fd50d9dcbe571f9dd7d7a58d66d1a3062a58e8ffe2ea223b8f72276c25c44324 18 0 199 c1 b97dfefabd3b3c1f3c29a873c87f7df4ad030e461d40bc44bfb5cf2e57cf9473 18 0 199 --- PASS: TestV1ToV2Transition (12.44s) allow 0 c1 9283176184ba517696fd8dc31230fc3b694d5770dfaf208609594ce70e0c6a53 18 0 199 c1 a2d1fd2e983c1484107a60d57f749d530d807ae3383159e681e8b595c6948e71 18 0 199 --- PASS: TestV1ToV2Transition (11.62s) allow 0 c1 c9cbd61f75f73d2e496d534324c0c9748b1a32f7a3fe682bc22d2f28358dac2e 18 0 199 c1 ce4cbb07b2bfa4572117590a2adcc6adaeb96b2ade19eb527461b2aa1769468f 18 0 199 --- PASS: TestV1ToV2Transition (10.58s) allow 0 c1 a7cef0441af65fab7e16af84e0819ea8b343adc90a691232ff82525a9dce4aa5 18 0 199 c1 e1e25ce9f92505b0327a65e87a46bd3b95f7b2fbe4091bac32fcc932a7ebc05a 18 0 199 --- PASS: TestV1ToV2Transition (12.51s) allow 0 c1 d62b073de0c9b6ecee083f49c3e0c3e6cc2e57425e14778f5bc9188ee57ff9fa 18 0 199 c1 1e0bb80bbde3641b41f72854015d7e979149db12b30bf9a53d9b50b1ca1ff262 18 0 199 --- PASS: TestV1ToV2Transition (11.44s) allow 0 c1 41f917fc994d6522c68d0e08b2deaec87933e548750c6770f3a1960d6c0924c1 18 0 199 c1 36ed7c3160c61b6e3c5d16b556adfe8f5b2d4b01a603340384ff97396a5dfb4e 18 0 199 --- PASS: TestV1ToV2Transition (12.58s) allow 0 c1 13ad49d48bb65033023b3141eb17324d329688c58fe7b1be2138a74ea167f4fd 18 0 199 c1 f95dd1b198dfb744e76ff19901445e2c626d437f7c031b7505e757f288547304 18 0 199 --- PASS: TestV1ToV2Transition (12.52s) allow 0 c1 9ebc51d0e407140bdd43156c9869ffde1e2369008003da392ecda8bdb986fc57 18 0 199 c1 19fc69ac6107f74bed4d5a9452ab0452d8af29cc1bf14051f3ebaa9e45c84b29 18 0 199 --- PASS: TestV1ToV2Transition (12.51s) allow 0 c1 b25992fda89d96b899c859649d78f00526b2a6da6dfd9d3f7d7ce4a2979d2a2e 18 0 199 c1 465d4f518fc56d303eae4dfe83602542e8f28441bc852de572815c9b7adac4d3 18 0 199 --- PASS: TestV1ToV2Transition (12.49s) allow 0 c1 40bd8572c80439e6570fb1d14c4e3db4b1785030e4484a3b8407dd249e29faaf 18 0 199 c1 84145fefe58df7fb6ebbbfdf2d5c94ce729ebb2e0242f850a2642a550c50d29d 18 0 199 --- PASS: TestV1ToV2Transition (12.57s) allow 0 c1 7a21f32c6668bbbc64826613fc480e8671d282f3f62383b931e69d0cae7b24d8 18 0 199 c1 4048a4ff072f95c55de76a7c39ef54b39fab04154ff436e44c40465b5bffa7d4 18 0 199 --- PASS: TestV1ToV2Transition (12.52s) allow 0 c1 3bd826b9d1357e64724d1c58cf59dcccd4e61652ae3d9eb8715852b5cc2bb6cf 18 0 199 c1 7614692076c444fe19812e77b5d72fbcdc153c13e3e8139f16450eae65962bb5 18 0 199 --- PASS: TestV1ToV2Transition (10.48s) allow 0 c1 a9c290867205feee6e6637848be56a38be49127c650e05959efe02a8ec926469 18 0 199 c1 492c284c42057d1aac9496896d047cbc66e4d55cac848c72ea9252408ef7db33 18 0 199 --- PASS: TestV1ToV2Transition (12.51s) allow 0 c1 7d1a090f55d442a6bff40675bc217df9e64ab3ebad5d7e704706828804afee3a 18 0 199 c1 eab6bd044144573f6293ee2ff74af36656af6b80e32276c1a98fb3f073005394 18 0 199 --- PASS: TestV1ToV2Transition (11.96s) allow 0 c1 4fc34567862fcf41c8d74fca26f5ba7403d6aac67507bf78398e84d477282cec 18 0 199 c1 e8fdeec93423d26fe4a6ef19bb39e408895df0aad2b7f3a16ec6c0e2d80c082a 18 0 199 --- PASS: TestV1ToV2Transition (10.72s) allow 0 c1 ef109466c6f53ececdc018ca7ffedb3d69eb7aa4053fb23e93fbf9deb6897383 18 0 199 c1 138a155fad9beccc0f132ffbdae5ea6ad51e424bdac0a28887a1e32c124f34c6 18 0 199 --- PASS: TestV1ToV2Transition (12.52s) allow 0 c1 0902e0557b57bdb7e4d69f4932bcec967de571e3177db9d7e492e04c11dae13f 18 0 199 c1 883e9bde1bc0d631ec22ace19badc7b50dec6a095e0796b554eab89f9d2ed6dd 18 0 199
}
usedHosts[c.HostKey] = struct{}{}
}
Expand Down

0 comments on commit ab343c5

Please sign in to comment.