From 0e18e9699758a7bb183d7f9d0b7750c88ac84588 Mon Sep 17 00:00:00 2001 From: Travis Person Date: Thu, 16 Feb 2023 23:12:07 +0000 Subject: [PATCH] fixup! fixup! feat: stmgr: add env to disable premigrations --- chain/stmgr/forks_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chain/stmgr/forks_test.go b/chain/stmgr/forks_test.go index c83c0911b36..52cfe5fce87 100644 --- a/chain/stmgr/forks_test.go +++ b/chain/stmgr/forks_test.go @@ -543,9 +543,12 @@ func TestDisablePreMigration(t *testing.T) { cg, err := gen.NewGenerator() require.NoError(t, err) - os.Setenv(EnvDisablePreMigrations, "1") + err = os.Setenv(EnvDisablePreMigrations, "1") + require.NoError(t, err) + defer func() { - os.Unsetenv(EnvDisablePreMigrations) + err := os.Unsetenv(EnvDisablePreMigrations) + require.NoError(t, err) }() counter := make(chan struct{}, 10) @@ -569,7 +572,6 @@ func TestDisablePreMigration(t *testing.T) { PreMigration: func(ctx context.Context, _ *StateManager, _ MigrationCache, _ cid.Cid, _ abi.ChainEpoch, _ *types.TipSet) error { panic("should be skipped") - return nil }, }}}, },