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

"user can edit mail headers" intermittendly failing #383

Closed romanofski closed 4 years ago

romanofski commented 4 years ago

Describe the bug The user acceptance test "user can edit mail headers" seems to be intermittendly failing.

To Reproduce Currently can not be 100% reproduced. It got picked up by our cron job. Interestingly a cron job before failed with the same job too: https://travis-ci.org/github/purebred-mua/purebred/jobs/672707006 That is the GHC 8.6.5 job.

Expected behavior Job passes - always.

Screenshots Log output:

user can edit mail headers:                               FAIL (1.92s)
    start composition           (0.03s)
    accept default              (0.03s)
    enter to: email             (0.03s)
    leave default               (0.03s)
    enter mail body
    exit insert mode in vim
    exit vim                    (0.03s)
    user can change from header (0.03s)
    append an email             (0.03s)
      src/Test/Tasty/Tmux.hs:445:
      Condition not met: 'Regex "Purebred:.*ComposeView-Attachments\\s+$^$"'.  Last capture:

                 From: "Joe Bloggs" <joe@foo.test>, testuser@foo.test                  
                  To: user@to.test                                                    
                  Cc:                                                                 
                 Bcc:                                                                 
             Subject:                                                                 

       -- Attachments-----------------------------------------------------------------
       I --                                               text/plain; charset=us-ascii

      Purebred: (0,46) [ New: 0  ]           ComposeView-Editor to Compose a new Mail 
      From: "Joe Bloggs" <joe@foo.test>, testuser@foo.test                            

       raw: "          From: \"Joe Bloggs\" <joe@foo.test>, testuser@foo.test                  \n            To: user@to.test                                                    \n            Cc:                                                                 \n           Bcc:                                                                 \n       Subject:                                                                 \n                                                                                \n\ESC[30m\ESC[43m -- Attachments-----------------------------------------------------------------\n\ESC[34m I --                                               text/plain; charset=us-ascii\n\ESC[49m                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n                                                                                \n\ESC[30m\ESC[43mPurebred: (0,46) [ New: 0  ]           ComposeView-Editor to Compose a new Mail \n\ESC[33m\ESC[40mFrom: \ESC[37m\"Joe Bloggs\" <joe@foo.test>, testuser@foo.test 

Additional context None

romanofski commented 4 years ago

Attached an example failure log.txt

romanofski commented 4 years ago

Failed again today: https://travis-ci.org/github/purebred-mua/purebred/jobs/676044604 on Frasers pull request #385

romanofski commented 4 years ago

Last statement before the failure is:

    step "append an email"
    sendKeys ", testuser@foo.test\r" (Substring $ "From: "
                                      <> "\"Joe Bloggs\" <joe@foo.test>, testuser@foo.test")

I wonder whether the condition becomes true too early, since it is true for the editor line at the bottom as well as the field at the top in the UI.

Perhaps the better condition would actually be the one we assert in the next step: Purebred:.*ComposeView-Attachments\\s+$^$At least certainly that would indicate a change of focus to the attachments list.