// kill one task manager
TaskManager tm = ((LocalInstanceManager) jm.getInstanceManager()).getTaskManagers()[0];
tm.shutdown();
eg.waitForJobEnd();
// make sure that in any case, the network buffers are all returned
waitForTaskThreadsToBeTerminated();
assertTrue(bp1.isDestroyed() || bp1.numBuffers() == bp1.numAvailableBuffers());
assertTrue(bp2.isDestroyed() || bp2.numBuffers() == bp2.numAvailableBuffers());