forked from SeattleTestbed/repy_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test SeattleTestbed#52, issues with socket timeout
This patches `emulcomm` to provide some insight into the mechanics of too-large socket timeouts, and provides a unit test to trigger the instrumentation.
- Loading branch information
1 parent
4d53f71
commit af748b7
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
""" | ||
Test for SeattleTestbed/repy_v2#52, openconnection timeout issues | ||
""" | ||
timeout = 100 | ||
start_time = getruntime() | ||
log("Timeout", timeout, "Start time:", str(start_time), "\n") | ||
|
||
try: | ||
openconnection(gethostbyname("gmail.com"), 63100, getmyip(), 63100, timeout) | ||
except TimeoutError: | ||
pass | ||
except Exception, e: | ||
log(getruntime(), "Error raised: ", repr(e)) | ||
|
||
end_time = getruntime() | ||
log("End time: " + str(end_time)) | ||
log("Elapsed time: " + str(end_time - start_time)) | ||
log("\n") |