summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-07-17 11:16:59 +0100
committerGitHub <noreply@github.com>2018-07-17 11:16:59 +0100
commitc7320a5564c15a8f8e37a8562a4f434a20180daf (patch)
tree91bcc61fb57e0b62787486aaba875bfa183f5a44 /tests
parentMerge pull request #3530 from matrix-org/erikj/stream_cache (diff)
parentUse efficient .intersection (diff)
downloadsynapse-c7320a5564c15a8f8e37a8562a4f434a20180daf.tar.xz
Merge pull request #3544 from matrix-org/erikj/fixup_stream_cache
Fix perf regression in PR #3530
Diffstat (limited to 'tests')
-rw-r--r--tests/util/test_stream_change_cache.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/util/test_stream_change_cache.py b/tests/util/test_stream_change_cache.py
index fc45baaaa0..65b0f2e6fb 100644
--- a/tests/util/test_stream_change_cache.py
+++ b/tests/util/test_stream_change_cache.py
@@ -178,6 +178,22 @@ class StreamChangeCacheTests(unittest.TestCase):
             ),
         )
 
+        # Query a subset of the entries mid-way through the stream. We should
+        # only get back the subset.
+        self.assertEqual(
+            cache.get_entities_changed(
+                [
+                    "bar@baz.net",
+                ],
+                stream_pos=2,
+            ),
+            set(
+                [
+                    "bar@baz.net",
+                ]
+            ),
+        )
+
     def test_max_pos(self):
         """
         StreamChangeCache.get_max_pos_of_last_change will return the most