-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add timeout for validators #207
add timeout for validators #207
Conversation
bin/config.py
Outdated
@@ -74,7 +78,7 @@ | |||
grep -Ev '^(h|jobs|time|verbose)$' | sed "s/^/'/;s/$/',/" | tr '\n' ' ' | sed 's/^/args_list = [/;s/, $/]\n/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add timeout to this list
bin/interactive.py
Outdated
@@ -37,7 +37,7 @@ def run_interactive_testcase( | |||
output_validator = output_validators[0] | |||
|
|||
# Set limits | |||
validator_timeout = 60 | |||
validator_timeout = 2*config.DEFAULT_TIMEOUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better make this a separate constant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thanks! |
@mzuenni With |
@@ -64,17 +68,18 @@ | |||
'jobs': os.cpu_count() // 2, | |||
'time': 600, # Used for `bt fuzz` | |||
'verbose': 0, | |||
'timeout': DEFAULT_TIMEOUT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new issue is probably caused by this, since the computation for 1.5*timelimit now thinks there is a timelimit set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, in that case, it is probably a bad idea to set the timeout with a default value. I could instead add a function like this:
def get_timeout(default=DEFAULT_TIMEOUT):
return args.timeout or default
or i could add the or DEFAULT_TIMEOUT
everywhere. I am not sure which is better practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you could explicitly check if the timeout argument is set for solution timeout computation
That was not intentional and is somewhat related to #165? I was not aware that timeout is used for the TLE submissions ): the question is, do we want to keep the current behavior (and remove the default timeout as described above) or always set the problem TLE timeout to |
I am not sure if this breaks something else...