throws Exception {
TestAvatarQuiesceHandler h = new TestAvatarQuiesceHandler(event);
InjectionHandler.set(h);
setUp("testQuiesceWhenSavingNamespace: " + event, false);
// fail once
AvatarNode primary = cluster.getPrimaryAvatar(0).avatar;
AvatarNode standby = cluster.getStandbyAvatar(0).avatar;
createEdits(20);
// wait to the savers are up for some checkpoint
// and waiting until we interrupt
h.waitReachedSynchronizationPoint();
standby.quiesceStandby(getCurrentTxId(primary) - 1);
// SLS + ELS + SLS + 20 edits
assertEquals(23, getCurrentTxId(primary));
assertEquals(getCurrentTxId(primary), getCurrentTxId(standby));
if(expectException)
assertTrue(h.exceptionEvent);
//assert that the cancelled checkpoint was removed
long ckptTxId = h.cancelledCkptTxid;
for (Iterator<StorageDirectory> it = standby.getFSImage().dirIterator(); it
.hasNext();) {
StorageDirectory sd = it.next();
File image = new File(sd.getRoot(), NNStorage.getImageFileName(ckptTxId));
assertFalse(image.exists());
assertFalse(new File(sd.getRoot(),