Http oracle timeout#1608
Conversation
| //in SuperAgent, verb must be first | ||
| handleVerbEndpoint(baseUrlOfSut, call, lines) | ||
| //client timeout, same source as fuzzing tcpTimeoutMs | ||
| lines.add(".timeout({response: EM_HTTP_TIMEOUT_MS, deadline: EM_HTTP_TIMEOUT_MS})") |
There was a problem hiding this comment.
this EM_HTTP_TIMEOUT_MS is referring to a variable declared elsewhere? in such case, the name of the variable should be put in a shared constant
|
|
||
| // message for the assertion that flags a missing expected timeout (Java/Kotlin/C#) | ||
| // JS uses await expect(...).rejects.toThrow() and Python uses with self.assertRaises(...) | ||
| private const val EXPECTED_TIMEOUT_MSG = "Expected a timeout" |
There was a problem hiding this comment.
use JavaDoc style /** */ for comments on fields and methos
| lines.add("process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';") | ||
| lines.add("const superagent = require(\"superagent\");") | ||
| // HTTP client timeout (ms) | ||
| lines.add("const EM_HTTP_TIMEOUT_MS = ${config.tcpTimeoutMs};") |
There was a problem hiding this comment.
this name EM_HTTP_TIMEOUT_MS should be in a shared constant, as re-used in few places
| } | ||
| lines.add("from $pythonUtilsFilenameNoExtension import *") | ||
| // HTTP client timeout (seconds) | ||
| lines.add("EM_HTTP_TIMEOUT = ${config.tcpTimeoutMs / 1000.0}") |
| analyzeHttpSemantics(individual, actionResults, fv) | ||
| } | ||
|
|
||
| if(config.blackBox && config.isEnabledFaultCategory(ExperimentalFaultCategory.HTTP_TIMEOUT)){ |
There was a problem hiding this comment.
add comment specifying why we are skipping for white-box testing
| add(".get(self.baseUrlOfSut + \"/\",") | ||
| indent() | ||
| add("headers=headers, verify=False)") | ||
| add("headers=headers, timeout=EM_HTTP_TIMEOUT, verify=False)") |
There was a problem hiding this comment.
otherwise, otherwise if we change name in future, we will break lot of places
| res_0 = requests \ | ||
| .get(self.baseUrlOfSut + "/foo", | ||
| headers=headers, verify=False) | ||
| headers=headers, timeout=EM_HTTP_TIMEOUT, verify=False) |
There was a problem hiding this comment.
constant. also, we need a way to make it easier and do not confuse when we us MS or S version
| ) { args: MutableList<String> -> | ||
|
|
||
| setOption(args, "useExperimentalOracles", "true") | ||
| setOption(args, "tcpTimeoutMs", "2000") |
There was a problem hiding this comment.
shouldn't this test fail because by default we have httpOracles being false?
Python test case
JS test case
Kotlin:
Java