(t *testing.T)
| 417 | } |
| 418 | |
| 419 | func TestFreelist_E2E_Rollbacks(t *testing.T) { |
| 420 | freelist := newTestFreelist() |
| 421 | freelist.Init([]common.Pgid{}) |
| 422 | freelist.Free(common.Txid(2), common.NewPage(5, common.LeafPageFlag, 0, 1)) |
| 423 | freelist.Free(common.Txid(2), common.NewPage(8, common.LeafPageFlag, 0, 0)) |
| 424 | requirePages(t, freelist, common.Pgids{}, common.Pgids{5, 6, 8}) |
| 425 | freelist.Rollback(common.Txid(2)) |
| 426 | requirePages(t, freelist, common.Pgids{}, common.Pgids{}) |
| 427 | |
| 428 | // unknown transaction should not trigger anything |
| 429 | freelist.Free(common.Txid(4), common.NewPage(13, common.LeafPageFlag, 0, 3)) |
| 430 | requirePages(t, freelist, common.Pgids{}, common.Pgids{13, 14, 15, 16}) |
| 431 | freelist.ReleasePendingPages() |
| 432 | requirePages(t, freelist, common.Pgids{13, 14, 15, 16}, common.Pgids{}) |
| 433 | freelist.Rollback(common.Txid(1337)) |
| 434 | requirePages(t, freelist, common.Pgids{13, 14, 15, 16}, common.Pgids{}) |
| 435 | } |
| 436 | |
| 437 | func TestFreelist_E2E_RollbackPanics(t *testing.T) { |
| 438 | freelist := newTestFreelist() |
nothing calls this directly
no test coverage detected