Closes selenium session when suite finished to run

@see org.testng.ISuiteListener#onFinish(org.testng.ISuite)
11195
@Override
    public void onFinish(ISuite suite) {
        logger.entering(suite);
        if (ListenerManager.isCurrentMethodSkipped(this)) {
            logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG);
            return;
        }
        LocalGridManager.shutDownHub();
        logger.exiting();
    }
1233300
@Override
  public void closeSession(SessionHandle sessionHandle) throws HiveSQLException {
    try {
      TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle());
      TCloseSessionResp resp = cliService.CloseSession(req);
      checkStatus(resp.getStatus());
    } catch (HiveSQLException e) {
      throw e;
    } catch (Exception e) {
      throw new HiveSQLException(e);
    }
  }
69718
public boolean isFinished()
	{
		if (finished)
			return true;

		try
		{
			final int code = exitCode();

			finished(code);

			return true;
		}
		catch (IllegalThreadStateException e)
		{
			return false;
		}
	}
353537
public static void closeQuietly(final Session session)
    {
        if (session != null) {
            try {
                session.close();
            }
            catch (JMSException je) {
                if (je.getCause() instanceof InterruptedException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedException");
                }
                if (je.getCause() instanceof InterruptedIOException) {
                    LOG.trace("ActiveMQ caught and wrapped InterruptedIOException");
                }
                else {
                    LOG.warnDebug(je, "While closing session");
                }
            }
        }
    }
384080
def terminate(self):
        

        self.info_log('The test batch is finished.')

        with DbSessionContext(BROME_CONFIG['database']['mongo_database_name']) as session:  # noqa
            test_batch = session.query(Testbatch)\
                .filter(Testbatch.mongo_id == self.test_batch_id).one()
            test_batch.ending_timestamp = utcnow()
            test_batch.terminated = True
            session.save(test_batch, safe=True)

        self.print_test_summary(self.executed_tests)
1017669
void terminate( boolean removeFromActiveSession ) {
        if (!isLive()) {
            return;
        }

        isLive = false;

        JcrObservationManager jcrObservationManager = observationManager();
        if (jcrObservationManager != null) {
            jcrObservationManager.removeAllEventListeners();
        }

        cleanLocks();
        if (removeFromActiveSession) this.repository.runningState().removeSession(this);
        this.context.getSecurityContext().logout();
    }
911255
function finished(ev) {
          if (ev && ev.target !== element[0]) return;

          if (ev) $timeout.cancel(timer);
          element.off($mdConstant.CSS.TRANSITIONEND, finished);

          // Never reject since ngAnimate may cause timeouts due missed transitionEnd events
          resolve();

        }
1007261
@Override
    protected void onSessionClose(long sessionId, Map<Long, Object> responses) {
        SessionSemaphoreState state = sessionStates.get(sessionId);
        if (state != null) {
            // remove the session after release() because release() checks existence of the session
            if (state.acquiredPermits > 0) {
                SemaphoreEndpoint endpoint = new SemaphoreEndpoint(sessionId, 0);
                ReleaseResult result = release(endpoint, newUnsecureUUID(), state.acquiredPermits);
                assert result.cancelled.isEmpty();
                for (AcquireInvocationKey key : result.acquired) {
                    responses.put(key.commitIndex(), Boolean.TRUE);
                }
            }

            sessionStates.remove(sessionId);
        }
    }
560893
public function onFinish()
    {
        $this->appInstance->unsubscribe('s2c:' . $this->sessId, [$this, 's2c']);
        $this->appInstance->unsubscribe('w8in:' . $this->sessId, [$this, 'w8in']);
        Timer::remove($this->heartbeatTimer);
        if ($this->heartbeatOnFinish) {
            $this->sendFrame('h');
        }
        parent::onFinish();
    }
343357
function () {
    // clear the action queue
    this.actionQueue = [];
    
    // kill the session
    var promise = this.webdriverClient.deleteSession();

    // emit the run.complete event
    promise.then(function () {
      this.events.emit('driver:message', {key: 'run.complete', value: null});
    }.bind(this));

    return this;
  }
1251485
public void closeElement() throws XMLException, IOException {
		if (!Type.START_ELEMENT.equals(event.type))
			throw new IOException("Invalid call of closeElement: it must be called on a start element");
		if (event.isClosed) return;
		ElementContext ctx = event.context.getFirst();
		do {
			try { next(); }
			catch (EOFException e) {
				throw new XMLException(getPosition(), "Unexpected end", "closeElement(" + ctx.text.asString() + ")");
			}
			if (Type.END_ELEMENT.equals(event.type)) {
				if (event.context.getFirst() == ctx)
					return;
			}
		} while (true);
	}
949917
def finalize(self):
        '''
        
        '''
        self._condition.acquire()
        try:
            if self._nconnections != len(self._pool):
                warnings.warn('finalize() called with unreleased connections', RuntimeWarning, 2)

            while self._pool:
                self._close(self._pool.pop().connection)
            self._nconnections = 0
        finally:
            self._condition.release()
325681
@Override
	public final void close(@NotNull Throwable e) {
		if (isProcessComplete()) return;
		processComplete = true;
		doClose(e);
		processCompletion.trySetException(e);
		afterProcess(e);
	}
103155
public function onFinish()
    {
        parent::onFinish();
        $this->event('disconnect');
        if (isset($this->xml)) {
            $this->xml->finish();
        }
        unset($this->roster);
        if ($this->keepaliveTimer) {
            Timer::remove($this->keepaliveTimer);
        }
    }
237312
public static void finishIfApplicableAndLogException(Object toFinish) {
    try {
      finishIfApplicable(ImmutableList.of(toFinish));
    } catch (Exception e) {
      log.info("Exception while finishing {}: {}", toFinish, e);
    }
  }
637105
function maybeFinish() {
        if (to !== null) clearTimeout(to);
        to = setTimeout(function() {
            var alldone = true;
            var names = Object.keys(files);
            for (var i=0; i<names.length; i++) {
                if (!files[names[i]]["done"]) {
                    alldone = false;
                    break;
                }
            }
            if (alldone && !returned) {
                returned = true;
                callback(null);
            }
        }, 1000);
    }
13516
protected final void closeSessionAndClearTokenInformation() {
        if (sessionTracker != null) {
            Session currentSession = sessionTracker.getOpenSession();
            if (currentSession != null) {
                currentSession.closeAndClearTokenInformation();
            }
        }
    }