-
Notifications
You must be signed in to change notification settings - Fork 63
/
env_test.go
32 lines (23 loc) · 745 Bytes
/
env_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package grocksdb
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestEnv(t *testing.T) {
t.Parallel()
env := NewDefaultEnv()
defer env.Destroy()
env.SetBackgroundThreads(2)
require.Equal(t, 2, env.GetBackgroundThreads())
env.SetHighPriorityBackgroundThreads(5)
require.Equal(t, 5, env.GetHighPriorityBackgroundThreads())
env.SetLowPriorityBackgroundThreads(6)
require.Equal(t, 6, env.GetLowPriorityBackgroundThreads())
env.SetBottomPriorityBackgroundThreads(14)
require.Equal(t, 14, env.GetBottomPriorityBackgroundThreads())
env.JoinAllThreads()
env.LowerHighPriorityThreadPoolCPUPriority()
env.LowerHighPriorityThreadPoolIOPriority()
env.LowerThreadPoolCPUPriority()
env.LowerThreadPoolIOPriority()
}