purebred-mua / purebred

A terminal based mail user agent based on notmuch
GNU Affero General Public License v3.0
139 stars 19 forks source link

fix flaky UAT test #501

Closed romanofski closed 1 year ago

romanofski commented 1 year ago

The test flaked because of a race condition between showing the error message and our validation on the input fields. The validation would race with rendering the error and showing the "all clear".

Fixes https://github.com/purebred-mua/purebred/issues/429

romanofski commented 1 year ago

Just saw another test flaking out. Possibly the same problem. Will update.

frasertweedale commented 1 year ago

LGTM, but are you still planning to extend this patch?

romanofski commented 1 year ago

Yeah will have a quick look whether the failure is caused by the same problem

romanofski commented 1 year ago

Bit of a tricky one but it doesn't seem to be caused by the previous input validations. Unfortunately the reproducer doesn't apply here so can't say for sure that it's not related.

I guess the late running thread could be generally a source of flakes but I thought adding a threadDelay everywhere we use input fields with validation would be silly. Currently it doesn't cause too much trouble either.

I guess if it's really a pain we should perhaps use an environment variable to fire validation immediately so we can avoid the delays.

frasertweedale commented 1 year ago

If you're done, I'm happy with this so feel free to merge.