title: xcode 7.3 UI test randomly pass or fail
body: <p>I was just practicing TDD and wrote a very simple function for a testing app. The UI is simple: it has a button with "0" as its title initially. In my view controller, I have a local variable "score". Every time I tap the button it would increase the "score". The button title will be updated with the new "score" value. The button ui update logic is in "score"'s "didSet" property observer. </p>
  
  <p>Everything is cool except the UI testing. I have two ui test functions, one is to tap the button once and another is to tap the button twice. Now the weird thing happens. Below are the screenshots of my two ui test functions.</p>
  
  <p><a href="https://i.stack.imgur.com/5nza2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5nza2.png" alt="enter image description here"></a></p>
  
  <p>Every time I ran the test, sometimes both functions passed while sometimes one or two of them failed. The error is always as shown "aNumber is not equal to aNumber + 1". Looks like there are some respond time issue. It seems like the UI update is much slower than the button label result retrieval. I'm not sure whether I get the value of button.label too soon before it was really updated. Should I even update the UI in property observers? Is there any solution to pass the ui test? Appreciates for your helps!</p>