(t *testing.T)
| 313 | } |
| 314 | |
| 315 | func TestTxnTooBig(t *testing.T) { |
| 316 | runBadgerTest(t, nil, func(t *testing.T, db *DB) { |
| 317 | data := func(i int) []byte { |
| 318 | return []byte(fmt.Sprintf("%b", i)) |
| 319 | } |
| 320 | // n := 500000 |
| 321 | n := 1000 |
| 322 | txn := db.NewTransaction(true) |
| 323 | for i := 0; i < n; { |
| 324 | if err := txn.SetEntry(NewEntry(data(i), data(i))); err != nil { |
| 325 | require.NoError(t, txn.Commit()) |
| 326 | txn = db.NewTransaction(true) |
| 327 | } else { |
| 328 | i++ |
| 329 | } |
| 330 | } |
| 331 | require.NoError(t, txn.Commit()) |
| 332 | |
| 333 | txn = db.NewTransaction(true) |
| 334 | for i := 0; i < n; { |
| 335 | if err := txn.Delete(data(i)); err != nil { |
| 336 | require.NoError(t, txn.Commit()) |
| 337 | txn = db.NewTransaction(true) |
| 338 | } else { |
| 339 | i++ |
| 340 | } |
| 341 | } |
| 342 | require.NoError(t, txn.Commit()) |
| 343 | }) |
| 344 | } |
| 345 | |
| 346 | func TestForceCompactL0(t *testing.T) { |
| 347 | dir, err := ioutil.TempDir("", "badger-test") |
nothing calls this directly
no test coverage detected
searching dependent graphs…