Test change between "empty" (16KB) and "non-empty" db
(t *testing.T)
| 21 | |
| 22 | // Test change between "empty" (16KB) and "non-empty" db |
| 23 | func TestMlock_DbCanGrow_Small(t *testing.T) { |
| 24 | // 32KB |
| 25 | skipOnMemlockLimitBelow(t, 32*1024) |
| 26 | |
| 27 | db := btesting.MustCreateDBWithOption(t, &bolt.Options{Mlock: true}) |
| 28 | |
| 29 | if err := db.Update(func(tx *bolt.Tx) error { |
| 30 | b, err := tx.CreateBucketIfNotExists([]byte("bucket")) |
| 31 | if err != nil { |
| 32 | t.Fatal(err) |
| 33 | } |
| 34 | |
| 35 | key := []byte("key") |
| 36 | value := []byte("value") |
| 37 | if err := b.Put(key, value); err != nil { |
| 38 | t.Fatal(err) |
| 39 | } |
| 40 | |
| 41 | return nil |
| 42 | }); err != nil { |
| 43 | t.Fatal(err) |
| 44 | } |
| 45 | |
| 46 | } |
| 47 | |
| 48 | // Test crossing of 16MB (AllocSize) of db size |
| 49 | func TestMlock_DbCanGrow_Big(t *testing.T) { |
nothing calls this directly
no test coverage detected