Skip to content

Issue 3211 fix flaky tests part 4 - #3358

Draft
DenBond7 wants to merge 5 commits into
masterfrom
issue_3211_fix_flaky_tests_part_4
Draft

DenBond7 wants to merge 5 commits into
masterfrom
issue_3211_fix_flaky_tests_part_4

Conversation

@DenBond7

Copy link
Copy Markdown
Collaborator

This PR <what does it do and why?>

close #0000 // if this PR closes an issue

issue #0000 // if it doesn't close the issue yet


Tests (delete all except exactly one):

  • Does not need tests (refactor only, docs or internal changes)
  • Difficult to test (explain why)
  • Not worth testing
  • Tests will be added later (issue #...)
  • Tests added or updated

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities

…Fail

The test mixed up field indexes (it restored wrong values into the next
fields), never checked the network error title, and relied on the common
idling resource, which can miss the settings check. The test servers
pointed to 10.0.2.3, where a connection hangs until the 30 s timeout, so
the run time and the outcome depended on what was left in the form.

Use hosts of *.flowcrypt.test, where the IMAP and SMTP ports are closed,
set one incorrect value per check and restore it afterwards, and wait for
the result dialog.
StandardForwardOfEncryptedPgpMimeMessageWithOriginalAttachmentsComposeGmailApiFlow
was ignored, but CI history since August shows one failure without a stack
trace, and it passes on a slow CI-like emulator. Run it with @FlakyTest like
the other forward tests to collect data on CI.

Wait for the forwarded attachments on the compose screen instead of a fixed
sleep, and for the message details screen after sending, before pressing
Back, as the sibling forward tests do.
All its CI failures since August were infrastructure problems (the system
crashed during instrumentation, or the device went offline), not test
failures. It passes on a slow CI-like emulator.
The app keeps JavaScript disabled in WebViews, and tests enable it with
forceJavascriptEnabled() right before a web check. That only calls
setJavaScriptEnabled(true), and the setting reaches the renderer
asynchronously. On a slow CI emulator the check ran first and failed with
"Could not parse: null" or a 10 s timeout, although the message was already
rendered (4 MessageDetailsFlowTest tests on master, every retry failed the
same way because each retry starts a new WebView).

Add checkWebViewWithJavascript() that enables JavaScript and retries the
check for up to 30 s, then runs it once more to fail with the real error.
…lowTest

The test passes against the local mail server, but it had fixed sleeps and
short waits that silently continued on timeout. Wait for concrete states
instead: the create key button (the app checks the settings and searches for
backups first), the evaluated passphrase strength (the button does nothing
before it), and the attester call.

The app sends a backup of the created key to the inbox, and other tests
expect that this user has no backups. The mail server delivers the email
asynchronously, so the cleanup now waits for it before deleting it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant