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 }, }}}, },