Skip to content

Commit

Permalink
Try #6193:
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemesh-bors[bot] authored Aug 1, 2024
2 parents 5a6e94b + 3ff47c1 commit 272aebc
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/systest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
inputs:
test_name:
description: "Test to run"
default: "."
default: "TestCheckpoint"
log_level:
description: "Log level"
default: "debug"
Expand Down
36 changes: 34 additions & 2 deletions cmd/bootstrapper/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,40 @@ func (s *Server) Start(ctx context.Context, errCh chan error, params *NetworkPar
// start generating fallback data
s.eg.Go(
func() error {
s.genDataLoop(ctx, errCh, last, params.updateActiveSetTime, s.GenFallbackActiveSet)
return nil
var (
errs = 0
maxErrs = 10
timer *time.Timer
timeC <-chan time.Time
backoff = 10 * time.Second
)
for epoch := last; ; epoch++ {
wait := time.Until(params.updateActiveSetTime(epoch))
select {
case <-timeC:
if err := s.GenFallbackActiveSet(ctx, epoch); err != nil {
errs++
timer.Reset(backoff)
continue
}
errs = 0
if !timer.Stop() {
<-timer.C
}
timeC = nil
case <-time.After(wait):
if err := s.GenFallbackActiveSet(ctx, epoch); err != nil {
timer = time.NewTimer(backoff)
timeC = timer.C
if errs >= maxErrs {
errCh <- err
return err
}
}
case <-ctx.Done():
return ctx.Err()
}
}
})
s.eg.Go(
func() error {
Expand Down
3 changes: 2 additions & 1 deletion config/presets/fastnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func fastnet() config.Config {
conf.LayerDuration = 15 * time.Second
conf.Sync.Interval = 5 * time.Second
conf.Sync.GossipDuration = 10 * time.Second
conf.Sync.AtxSync.EpochInfoInterval = 20 * time.Second
conf.Sync.AtxSync.EpochInfoInterval = 1 * time.Second
conf.Sync.AtxSync.EpochInfoPeers = 10
conf.Sync.MalSync.IDRequestInterval = 20 * time.Second
conf.LayersPerEpoch = 4
conf.RegossipAtxInterval = 30 * time.Second
Expand Down
4 changes: 2 additions & 2 deletions syncer/atxsync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func DefaultConfig() Config {
return Config{
EpochInfoInterval: 4 * time.Hour,
AtxsBatch: 1000,
RequestsLimit: 10,
EpochInfoPeers: 2,
RequestsLimit: 100,
EpochInfoPeers: 20,
ProgressFraction: 0.1,
ProgressInterval: 20 * time.Minute,
}
Expand Down
4 changes: 2 additions & 2 deletions systest/cluster/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ var (
"requests and limits for smesher container",
&apiv1.ResourceRequirements{
Requests: apiv1.ResourceList{
apiv1.ResourceCPU: resource.MustParse("1.3"),
apiv1.ResourceCPU: resource.MustParse("0.8"),
apiv1.ResourceMemory: resource.MustParse("800Mi"),
},
Limits: apiv1.ResourceList{
apiv1.ResourceCPU: resource.MustParse("1.3"),
apiv1.ResourceCPU: resource.MustParse("0.8"),
apiv1.ResourceMemory: resource.MustParse("800Mi"),
},
},
Expand Down
16 changes: 14 additions & 2 deletions systest/tests/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ func reuseCluster(tctx *testcontext.Context, restoreLayer uint32) (*cluster.Clus
)
}

func TestCheckpoint1(t *testing.T) {
TestCheckpoint(t)
}

func TestCheckpoint2(t *testing.T) {
TestCheckpoint(t)
}

func TestCheckpoint3(t *testing.T) {
TestCheckpoint(t)
}

func TestCheckpoint(t *testing.T) {
// TODO(mafa): add new test with multi-smeshing nodes
t.Parallel()
Expand Down Expand Up @@ -169,15 +181,15 @@ func TestCheckpoint(t *testing.T) {
}

tctx.Log.Infow("waiting for all miners to be smeshing", "last epoch", checkpointEpoch+2)
ensureSmeshing(t, tctx, cl, checkpointEpoch+2)
ensureSmeshing(t, tctx, cl, checkpointEpoch+4)

// increase the cluster size to the original test size
tctx.Log.Info("cluster size changed to ", size)
tctx.ClusterSize = size
require.NoError(t, cl.AddSmeshers(tctx, addedLater))

tctx.Log.Infow("waiting for all miners to be smeshing", "last epoch", lastEpoch)
ensureSmeshing(t, tctx, cl, lastEpoch)
ensureSmeshing(t, tctx, cl, lastEpoch+6)
}

func ensureSmeshing(t *testing.T, tctx *testcontext.Context, cl *cluster.Cluster, stop uint32) {
Expand Down
1 change: 1 addition & 0 deletions systest/tests/distributed_post_verification_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
)

func TestPostMalfeasanceProof(t *testing.T) {
t.Skip()
t.Parallel()
testDir := t.TempDir()

Expand Down
1 change: 1 addition & 0 deletions systest/tests/equivocation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
)

func TestEquivocation(t *testing.T) {
t.Skip()
t.Parallel()
const bootnodes = 2
cctx := testcontext.New(t)
Expand Down
1 change: 1 addition & 0 deletions systest/tests/fallback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
)

func TestFallback(t *testing.T) {
t.Skip()
t.Parallel()

tctx := testcontext.New(t)
Expand Down
2 changes: 2 additions & 0 deletions systest/tests/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func init() {
}

func TestAddNodes(t *testing.T) {
t.Skip()
t.Parallel()

const (
Expand Down Expand Up @@ -125,6 +126,7 @@ func TestAddNodes(t *testing.T) {
}

func TestFailedNodes(t *testing.T) {
t.Skip()
t.Parallel()

tctx := testcontext.New(t)
Expand Down
2 changes: 2 additions & 0 deletions systest/tests/partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ func testPartition(t *testing.T, tctx *testcontext.Context, cl *cluster.Cluster,
}

func TestPartition_30_70(t *testing.T) {
t.Skip()
t.Parallel()

tctx := testcontext.New(t)
Expand All @@ -190,6 +191,7 @@ func TestPartition_30_70(t *testing.T) {
}

func TestPartition_50_50(t *testing.T) {
t.Skip()
t.Parallel()

tctx := testcontext.New(t)
Expand Down
3 changes: 3 additions & 0 deletions systest/tests/poets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var layersToCheck = parameters.Int(
)

func TestPoetsFailures(t *testing.T) {
t.Skip()
t.Parallel()
tctx := testcontext.New(t)
tctx.Log.Debug("TestPoetsFailures start")
Expand Down Expand Up @@ -123,6 +124,7 @@ func testPoetDies(t *testing.T, tctx *testcontext.Context, cl *cluster.Cluster)
}

func TestNodesUsingDifferentPoets(t *testing.T) {
t.Skip()
t.Parallel()
tctx := testcontext.New(t)
if tctx.PoetSize < 2 {
Expand Down Expand Up @@ -213,6 +215,7 @@ func TestNodesUsingDifferentPoets(t *testing.T) {
// TODO: When PoW support is removed, convert this test to verify only the cert path.
// https://github.com/spacemeshos/go-spacemesh/issues/5212
func TestRegisteringInPoetWithPowAndCert(t *testing.T) {
t.Skip()
t.Parallel()
tctx := testcontext.New(t)
tctx.PoetSize = 2
Expand Down
1 change: 1 addition & 0 deletions systest/tests/smeshing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
)

func TestSmeshing(t *testing.T) {
t.Skip()
// TODO(mafa): add new test with multi-smeshing nodes
t.Parallel()

Expand Down
1 change: 1 addition & 0 deletions systest/tests/timeskew_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
)

func TestShortTimeskew(t *testing.T) {
t.Skip()
t.Parallel()

tctx := testcontext.New(t)
Expand Down

0 comments on commit 272aebc

Please sign in to comment.