close method
Closes the broadcast event stream and drops all retained terminals (call
from an addTearDown).
Implementation
Future<void> close() async {
_terminals.clear();
_exitOutput.clear();
_lifecycles.clear();
for (final controller in _interaction.values) {
if (!controller.isClosed) unawaited(controller.close());
}
await _events.close();
}