Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent test failure in file browser test #327

Open
romanofski opened this issue Sep 14, 2019 · 12 comments · Fixed by #405
Open

Intermittent test failure in file browser test #327

romanofski opened this issue Sep 14, 2019 · 12 comments · Fixed by #405

Comments

@romanofski
Copy link
Member

Describe the bug
I've had a test run which seemed to have failed with an intermittent failure, since it only happend on the nix build. The last screenshot seems to suggest that for whatever reason the list item wasn't selecting the last remaining entity to trigger the error message.

Perhaps it is again a too generic intermittent step which causes the tests to skip too quickly?

To Reproduce
No idea at this point.

Expected behavior
Test run without a failure

Screenshots
See travis build log.txt

Additional context
None

@romanofski
Copy link
Member Author

Happened today again:

Screenshot_2019-10-22 Job #1171 2 - purebred-mua purebred - Travis CI

@romanofski
Copy link
Member Author

@frasertweedale frasertweedale changed the title Intermittend test failure in file browser test Intermittent test failure in file browser test Nov 2, 2019
@romanofski
Copy link
Member Author

romanofski commented Nov 14, 2019

I've looked into this a little bit today. The test steps seem fine and I can't find any sub strings which are too generic so the test run would skip ahead.

The only hypothesis I could come up with is perhaps the attachment list and it's length indicator in the status bar. Our test framework doesn't really let us assert that a string has been removed from the previous screen (maybe a feature we should implement?). Instead of asserting that the last file was deleted, because it's now missing, we use the item indicator in the status bar and assert with the list length, e.g. Item 1 of 2.

Now I'm wondering whether perhaps the list length is recalculated quicker (since it's asynchronous) than the redrawing of the entire UI can take place. In the screen shot the deleted list entry still looks like it's selected, even tho the entry is gone.

If that's a theory to pursue, I'm currently not sure what else to assert on which would be a stable indicator that the file is not in the list/UI.

@frasertweedale does that sound plausible as a possible cause?

@romanofski
Copy link
Member Author

romanofski added a commit that referenced this issue Nov 22, 2019
This test was failing now and then and the hypothesis causing the
failure is the thread traversing the spine of the list of threads. This
thread most likely evaluates the length of the displayed threads very
quickly. In fact there is only one thread to display, so the length is
most likely returned so quick, that the UI has not been repainted.

Last screen captures from tmux still show the last entry selected, even
though the entry itself is gone.

This patch asserts on the inverse that, the entry (the screen shot
attachment) is gone from the screen. This should be enough to basically
assert that the UI has been repainted.

Fixes #327
romanofski added a commit that referenced this issue Nov 28, 2019
This test was failing now and then and the hypothesis causing the
failure is the thread traversing the spine of the list of threads. This
thread most likely evaluates the length of the displayed threads very
quickly. In fact there is only one thread to display, so the length is
most likely returned so quick, that the UI has not been repainted.

Last screen captures from tmux still show the last entry selected, even
though the entry itself is gone.

This patch asserts on the inverse that, the entry (the screen shot
attachment) is gone from the screen. This should be enough to basically
assert that the UI has been repainted.

Fixes #327
@romanofski romanofski reopened this Dec 25, 2019
@romanofski
Copy link
Member Author

Had this come up again today in a test failure: https://travis-ci.org/purebred-mua/purebred/jobs/629258818?utm_medium=notification&utm_source=email

Unfortunately it seems, this issue isn't fixed yet :/

@romanofski
Copy link
Member Author

Screenshot_2019-12-25 Job #1328 1 - purebred-mua purebred - Travis CI

@romanofski
Copy link
Member Author

Looking into this closer, I wonder whether there was a slight chance that I had made the branch in which the above error appeared before I merged this fix. While I authored the fix in November, we kept it around for a while. I haven't seen the problem re-occur on master, so perhaps we keep this one open for another month or so and if it really doesn't appear again I'll close it.

@romanofski
Copy link
Member Author

This hasn't resurfaced in a few weeks now making me think that I must have created my branch with the problem in it. I'll close the issue.

@romanofski romanofski reopened this Apr 16, 2020
@romanofski
Copy link
Member Author

This job https://travis-ci.org/github/purebred-mua/purebred/jobs/675540114 seems to have failed at the same point.

@romanofski
Copy link
Member Author

Saw the failure again today. Attaching log.txt

@romanofski
Copy link
Member Author

Happened again today. Attaching
log.txt

romanofski added a commit that referenced this issue Aug 2, 2020
The change 47c72c2 tried to address the
intermittendly failing test, but I think made the mistake of
"hardcoding" the file we assume to be removing from the attachment list.

The problem however is, that the list of files we're adding as
attachment varies with the environment. While the `screenshot.png` is
probably the attachment in most cases, it isn't the attachment
in **all** cases. The assertion that the next screen does not show a
file which we never added is always true.

Instead, firstly, this patch asserts that the last filename is actually
listed as an attachment. Secondly, we assert that when the attachment is
removed the last file from before is gone. Furthermore we also check
whether the item count has changed.

Fixes: #327
romanofski added a commit that referenced this issue Aug 2, 2020
The change 47c72c2 tried to address the
intermittendly failing test, but I think made the mistake of
"hardcoding" the file we assume to be removing from the attachment list.

The problem however is, that the list of files we're adding as
attachment varies with the environment. While the `screenshot.png` is
probably the attachment in most cases, it isn't the attachment
in **all** cases. The assertion that the next screen does not show a
file which we never added is always true.

Instead, firstly, this patch asserts that the last filename is actually
listed as an attachment. Secondly, we assert that when the attachment is
removed the last file from before is gone. Furthermore we also check
whether the item count has changed.

Fixes: #327
@romanofski
Copy link
Member Author

@romanofski romanofski reopened this Aug 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant