Skip to content

Commit

Permalink
improve e2e activation tests stability (#6108)
Browse files Browse the repository at this point in the history
## Motivation

The e2e tests became flaky. In failed tests, the nipost builder fails to submit in poets on time because PoST proving took longer than the cycle gap.
  • Loading branch information
poszu committed Jul 9, 2024
1 parent 0ab8692 commit e716a01
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions activation/e2e/activation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func Test_BuilderWithMultipleClients(t *testing.T) {
genesis := time.Now().Add(layerDuration).Round(layerDuration)
poetCfg := activation.PoetConfig{
PhaseShift: epoch,
CycleGap: epoch / 2,
GracePeriod: epoch / 5,
CycleGap: 3 * epoch / 4,
GracePeriod: epoch / 4,
RequestTimeout: epoch / 5,
RequestRetryDelay: epoch / 50,
MaxRequestRetries: 10,
Expand Down
5 changes: 2 additions & 3 deletions activation/e2e/atx_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ var singerKeys = [2]string{
}

func Test_MarryAndMerge(t *testing.T) {
t.Parallel()
ctrl := gomock.NewController(t)
signers := signers(t, singerKeys[:])

Expand Down Expand Up @@ -242,8 +241,8 @@ func Test_MarryAndMerge(t *testing.T) {
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch,
CycleGap: epoch / 2,
GracePeriod: epoch / 5,
CycleGap: 3 * epoch / 4,
GracePeriod: epoch / 4,
}

client := ae2e.NewTestPoetClient(2)
Expand Down
5 changes: 2 additions & 3 deletions activation/e2e/checkpoint_merged_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
)

func Test_CheckpointAfterMerge(t *testing.T) {
t.Parallel()
ctrl := gomock.NewController(t)
signers := signers(t, singerKeys[:])

Expand Down Expand Up @@ -78,8 +77,8 @@ func Test_CheckpointAfterMerge(t *testing.T) {
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch,
CycleGap: epoch / 2,
GracePeriod: epoch / 5,
CycleGap: 3 * epoch / 4,
GracePeriod: epoch / 4,
}

client := ae2e.NewTestPoetClient(2)
Expand Down
12 changes: 6 additions & 6 deletions activation/e2e/nipost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func testPostConfig() activation.PostConfig {
cfg := activation.DefaultPostConfig()
// simplify PoST parameters for faster proving
cfg.K1 = 12
cfg.K2 = 10
cfg.K3 = 10
cfg.K2 = 8
cfg.K3 = 8
cfg.LabelsPerUnit = 64
return cfg
}
Expand Down Expand Up @@ -173,8 +173,8 @@ func TestNIPostBuilderWithClients(t *testing.T) {
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch / 2,
CycleGap: epoch / 4,
GracePeriod: epoch / 5,
CycleGap: 3 * epoch / 4,
GracePeriod: epoch / 4,
}

mclock := activation.NewMocklayerClock(ctrl)
Expand Down Expand Up @@ -267,8 +267,8 @@ func Test_NIPostBuilderWithMultipleClients(t *testing.T) {
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch / 2,
CycleGap: epoch / 4,
GracePeriod: epoch / 5,
CycleGap: 3 * epoch / 4,
GracePeriod: epoch / 4,
}

poetDb := activation.NewPoetDb(db, logger.Named("poetDb"))
Expand Down
4 changes: 2 additions & 2 deletions activation/e2e/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func TestValidator_Validate(t *testing.T) {
epoch := layersPerEpoch * layerDuration
poetCfg := activation.PoetConfig{
PhaseShift: epoch / 2,
CycleGap: epoch / 4,
GracePeriod: epoch / 5,
CycleGap: 3 * epoch / 4,
GracePeriod: epoch / 4,
}

poetDb := activation.NewPoetDb(sql.InMemory(), logger.Named("poetDb"))
Expand Down

0 comments on commit e716a01

Please sign in to comment.