2022-05-20 08:12:52 +00:00
|
|
|
package fdlimits_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
gethLimit "github.com/ethereum/go-ethereum/common/fdlimit"
|
2023-03-17 18:52:56 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v4/runtime/fdlimits"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/testing/assert"
|
2022-05-20 08:12:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestSetMaxFdLimits(t *testing.T) {
|
|
|
|
assert.NoError(t, fdlimits.SetMaxFdLimits())
|
|
|
|
|
|
|
|
curr, err := gethLimit.Current()
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
max, err := gethLimit.Maximum()
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
assert.Equal(t, max, curr, "current and maximum file descriptor limits do not match up.")
|
|
|
|
|
|
|
|
}
|