Make sure all jobs are finished.
179220
def wait_for_stats(self):
        """"""
        logging.debug("waiting for statistics to finish")
        for job in self.stat_jobs:
            job.get()
        sleep(2)
1331458
private void complete(KSplit split, KCall call) {
		reset(call.getProcess());
		split.split(call);
	}
157355
def finish_parallel(self):
        """"""
        for process in self.processes:
            process.join()

        # Shutdown the log thread
        log.debug('Joining log thread')
        self.log_queue.put(POISON_PILL)
        self.log_thread.join()
        self.log_queue.close()

        # Close all queues
        log.debug('Closing queues')
        self.task_queue.close()
        self.result_queue.close()
1245895
def finish_and_die(self):
        
        self.logstate('finish_and_die')
        self.stop_working_on_queue()
        if self.jobphase != 'pending_request':
            self.stopFactory()
1329111
def _clean(self):
        """"""
        if self._workers:
            for w in self._workers:
                if w.is_finished():
                    self._workers.remove(w)
        else:
            self._current_worker = None
            self._timer.stop()
871255
public function cleanUp()
    {
        // create a separate queue for each priority
        foreach (PriorityKeys::getAll() as $priorityKey) {
            $this->workers[$this->uniqueWorkerName($priorityKey)]->stop();
        }
    }
661614
function () {
        if (job.pull_requests < worker_count) {
            return false;
        }
        for (var i = 0; i < worker_count; i++) {
            if (!job.worker_complete[i]) {
                return false;
            }
        }
        return true;
    }
463028
function done() {
  	var storage = config.storage;

  	ProcessingQueue.finished = true;

  	var runtime = now() - config.started;
  	var passed = config.stats.all - config.stats.bad;

  	emit("runEnd", globalSuite.end(true));
  	runLoggingCallbacks("done", {
  		passed: passed,
  		failed: config.stats.bad,
  		total: config.stats.all,
  		runtime: runtime
  	});

  	// Clear own storage items if all tests passed
  	if (storage && config.stats.bad === 0) {
  		for (var i = storage.length - 1; i >= 0; i--) {
  			var key = storage.key(i);

  			if (key.indexOf("qunit-test-") === 0) {
  				storage.removeItem(key);
  			}
  		}
  	}
  }
1166405
public synchronized void complete() {
        if( logger.isInfoEnabled() ) {
            logger.info("[" + this + "] Marking complete");
        }
        if( loaded ) {
            return;
        }
        loaded = true;
        lastTouch = System.currentTimeMillis();
        if( waiting != null && waiting.isEmpty() ) {
            waiting = null;
        }
        notifyAll();
    }
1132713
protected function checkIfAllReady()
    {
        $this->checkQueue();
        if ($this->resultsNum >= $this->jobsNum) {
            $this->jobs = [];
            $this->state = self::STATE_DONE;
            foreach ($this->listeners as $cb) {
                $cb($this);
            }
            if (!$this->keep && $this->resultsNum >= $this->jobsNum) {
                $this->cleanup();
            }
        }
    }
1296062
def finish(self):
        
        self.repo.git.checkout(self.current_branch)
        self.repo.close()
683383
def task_done(self):
        """"""
        with self._lock:
            unfinished = self._unfinished_tasks - 1
            if unfinished < 0:
                raise RuntimeError('task_done() called too many times')
            elif unfinished == 0:
                self._alldone.notify()
            self._unfinished_tasks = unfinished
1037023
private void jobCompleted(JobInProgress job, JobSchedulingInfo oldInfo, 
                            QueueInfo qi) {
    LOG.info("Job " + job.getJobID().toString() + " submitted to queue " 
        + job.getProfile().getQueueName() + " has completed");
    //remove jobs from both queue's a job can be in
    //running and waiting queue at the same time.
    qi.removeRunningJob(oldInfo);
    qi.removeWaitingJob(oldInfo);
    // let scheduler know
    scheduler.jobCompleted(job);
  }
1092096
def _close(self):
        """"""
        callback = self.__callback
        self.__callback = None
        try:
            if callback:
                callback(None, InterfaceError('connection closed'))
        finally:
            # Flush the job queue, don't call the callbacks associated with the remaining jobs
            # since they have already been called as error callback on connection closing
            self.__job_queue = []
            self.__alive = False
            self.__stream.close()
957307
public void complete() {
        this.endDate = new Date();
        
        if (reports.stream().allMatch(report -> report.isSuccessful() == true)) {
            this.successful = true;
        }
    }
186507
private void finish() {
        try {
            GlobalEnablementBuilder globalEnablementBuilder = getBeanManager().getServices().get(GlobalEnablementBuilder.class);
            for (BeanRegistration registration : additionalBeans) {
                processBeanRegistration(registration, globalEnablementBuilder);
            }
            for (ObserverRegistration registration : additionalObservers) {
                processObserverRegistration(registration);
            }
        } catch (Exception e) {
            throw new DefinitionException(e);
        }
    }
31750
def completed_work_items(self):
        ""
        completed = self._conn.execute(
            "SELECT * FROM work_items, results WHERE work_items.job_id == results.job_id"
        )
        return ((_row_to_work_item(result), _row_to_work_result(result))
                for result in completed)