I think the intent was to have Petraeus testify by the administration thinking his affair was 'secret'. I do not see how the Republicans could have known if there was any there - there based upon a 'whistle-blower's contact. Hence Cantor went to the FBI director... Well next thing Petraeus resigns with the apparent expectation he would not have to testify.
That doesn't make sense. Petraeus is a witness. He has to testify if subpeona'd no matter what his current employment status is. In fact, now that he's out, maybe he can be more open and truthful than he would if he was under Ubanga's thumb. Petraeus better watch his back.