Skip to content

Commit

Permalink
fix multi process test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
da-da committed Jan 25, 2019
1 parent b4c9e00 commit 6b6f62f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from dns_cache import _set_dns_cache

GRADER_VERSION = '1.5.0'
GRADER_VERSION = '1.5.1'

if __name__ == '__main__':
report_logger.info("QiwuGrader ver {0}".format(GRADER_VERSION))
Expand Down
8 changes: 4 additions & 4 deletions grader_multitask.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def grade(self):

class GraderThread(GraderSkeleton, threading.Thread):

def __init__(self, shared_counter, test_config, time_counter=SharedCounter(), **kwargs):
def __init__(self, shared_counter, test_config, time_counter=SharedCounter(val_type='d'), **kwargs):
super(GraderThread, self).__init__(shared_counter, test_config, time_counter, kwargs)
threading.Thread.__init__(self)

Expand Down Expand Up @@ -59,13 +59,13 @@ def run(self):

class GraderProcess(GraderSkeleton, multiprocessing.Process):

def __init__(self, shared_counter, test_config, **kwargs):
super(GraderProcess, self).__init__(shared_counter, test_config, kwargs)
def __init__(self, shared_counter, test_config, time_counter=SharedCounter(val_type='d'), **kwargs):
super(GraderProcess, self).__init__(shared_counter, test_config, time_counter, kwargs)
multiprocessing.Process.__init__(self)

# use an internal counter to reduce global success counter locks
self.internal_counter = SharedCounter()
self.internal_timer = SharedCounter()
self.internal_timer = SharedCounter(val_type='d')

def grade(self):
# warm up threads
Expand Down

0 comments on commit 6b6f62f

Please sign in to comment.