diff --git a/test/simpledb/BufferPoolWriteTest.java b/test/simpledb/BufferPoolWriteTest.java index 676eba39..c4f7d8ad 100644 --- a/test/simpledb/BufferPoolWriteTest.java +++ b/test/simpledb/BufferPoolWriteTest.java @@ -109,16 +109,16 @@ public List insertTuple(TransactionId tid, Tuple t) // delete 504 tuples from the first page for (int i = 0; i < 504; ++i) { Tuple t = tuples.get(i); + HeapPage p = (HeapPage) Database.getBufferPool().getPage(tid, t.getRecordId().getPageId(), Permissions.READ_ONLY); Database.getBufferPool().deleteTuple(tid, t); - HeapPage p = (HeapPage) Database.getBufferPool().getPage(tid, t.getRecordId().getPageId(), Permissions.READ_ONLY); assertEquals(i+1, p.getNumEmptySlots()); } // delete 504 tuples from the second page for (int i = 0; i < 504; ++i) { Tuple t = tuples.get(i+504); + HeapPage p = (HeapPage) Database.getBufferPool().getPage(tid, t.getRecordId().getPageId(), Permissions.READ_ONLY); Database.getBufferPool().deleteTuple(tid, t); - HeapPage p = (HeapPage) Database.getBufferPool().getPage(tid, t.getRecordId().getPageId(), Permissions.READ_ONLY); assertEquals(i+1, p.getNumEmptySlots()); } }