fix race condition in test
diff --git a/pyserial/test/test.py b/pyserial/test/test.py
index c37f330..25a34c3 100644
--- a/pyserial/test/test.py
+++ b/pyserial/test/test.py
@@ -107,10 +107,10 @@
 
     def run(self):
         time.sleep(self.delay)
+        self.x.set()
         if not self.stopped:
             self.serial.write(data("E"))
             self.serial.flush()
-        self.x.set()
 
     def isSet(self):
         return self.x.isSet()
@@ -136,7 +136,7 @@
         a character is sent after some time to terminate the test (SendEvent)."""
         c = self.s.read(1)
         if not (self.event.isSet() and c == data('E')):
-            self.fail("expected marker")
+            self.fail("expected marker (evt=%r, c=%r)" % (self.event.isSet(), c))
 
 
 class Test2_Forever(unittest.TestCase):