From 5fedc06d7c3b2bc39c2e75712e8e00664d2aa6dd Mon Sep 17 00:00:00 2001 From: Clark Fischer <439978+clarkf@users.noreply.github.com> Date: Wed, 25 Jan 2023 14:27:02 +0000 Subject: [PATCH] Remove flaky test (#3098) I introduced a flaky test to confirm that `MegolmEncryption#prepareToEncrypt` didn't block the main thread too much, but it turns out that, when run in varying environments, it tends to fail. The same behavior is guaranteed by the following cancellation test - if the thread is blocked, it can't be cancelled. Signed-off-by: Clark Fischer Signed-off-by: Clark Fischer --- spec/unit/crypto/algorithms/megolm.spec.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/spec/unit/crypto/algorithms/megolm.spec.ts b/spec/unit/crypto/algorithms/megolm.spec.ts index 9f0ffae99..6c91d530f 100644 --- a/spec/unit/crypto/algorithms/megolm.spec.ts +++ b/spec/unit/crypto/algorithms/megolm.spec.ts @@ -579,15 +579,6 @@ describe("MegolmDecryption", function () { } }); - it("defers before completing", async () => { - megolm.prepareToEncrypt(room); - // Ensure that `Crypto#checkDeviceTrust` has been called *fewer* - // than the full nine times, after yielding once. - await sleep(0); - const callCount = mockCrypto.checkDeviceTrust.mock.calls.length; - expect(callCount).toBeLessThan(9); - }); - it("is cancellable", async () => { const stop = megolm.prepareToEncrypt(room);