Created
February 7, 2014 01:03
-
-
Save triffid/8855704 to your computer and use it in GitHub Desktop.
aprinter test_latency fix
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
diff --git a/host_stuff/test_latency.py b/host_stuff/test_latency.py | |
index d1c3645..55e8054 100755 | |
--- a/host_stuff/test_latency.py | |
+++ b/host_stuff/test_latency.py | |
@@ -4,6 +4,7 @@ from __future__ import print_function | |
import sys | |
import argparse | |
import time | |
+import re | |
import littlevent.close | |
import littlevent.error | |
import littlevent.loop | |
@@ -52,13 +53,14 @@ class Program (littlevent.close.Obj): | |
if self.writing: | |
print('ERROR: early response') | |
return self._quit() | |
- if data != 'ok\n': | |
- print('ERROR: unexpected response: >{}<'.format(data)) | |
- return self._quit() | |
- self.done_count += 1 | |
- if self.done_count >= self.want_count: | |
- return self._finished() | |
- self._write() | |
+ if re.search('^ok', data, re.M): | |
+ self.done_count += 1 | |
+ if self.done_count >= self.want_count: | |
+ return self._finished() | |
+ self._write() | |
+ return | |
+ print('WARN: unexpected response: >{}<'.format(data)) | |
+ return | |
def _write_handler (self, err): | |
assert self.writing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment