Repository navigation
Fix flaky mail test, Queue.restore and fake message grammar - #16
Merged
Merged
Conversation
Contributor
Author
Bot reviewChecked: The flaky test is still useful. The regex cuts only the text right after Blocking None. Non-blocking
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes.
1. Flaky test: "a 100 KB body is not in the error"
Problem: the test checks that the log and the saved error do not have
xxxxin them (the body isx* 100 KB). But the error also holds the encrypted details: a long random base64 text. Base64 uses the letterxtoo.Effect: about 1 in 300 encrypted texts has
xxxxin it by chance. One run makes several of them, so the test failed now and then (on main e8d6f6b and on #15), with no real leak. It was not a log line from another test.Fix: the test now cuts out the encrypted part (
Details are encrypted: <base64>) before it checks the text. If the details were ever plain text, the check still catches it, because plain text has spaces and is not cut.2. Queue.restore() did not undo Mail.useQueue()
Problem:
Queue.fake()callsMail.useQueue().Queue.restore()did not undo it.Effect: in a test with no
Queue.configure(),Mail.queue()still found a queue afterrestore().Fix:
restore()now sets the mail queue back: none when the queue was never configured, else this queue.3. Grammar of the fake messages
Problem: the check messages said "a AllTypesJob", "1 times" and "the 1 pushed X jobs".
Fix: they now say "an AllTypesJob", "1 time" and "the 1 pushed X job". The README already says that a failed check throws an
AssertionError, so no doc change was needed.Tests
restore()with no config,Mail.mailQueuethrows (fails without fix 2).dart testpass (SQLite only; Postgres, MariaDB and Redis run on CI).