Skip to content

Commit 1916819

Browse files
committed
Update test_filter_removed_access_documents for JS
Not checking for the filtered access removed doc notification for JS. Based on the discussion, we will not implement document ended notification for the docs rejected by the pull filter in JS. We may implement it based on demand. From Jens, this feature doesn’t make sense as the rejection from the user’s replication filters shouldn’t be treat as an error. Also it happens on the platform as a side effect due to an error thrown by LiteCore. I have created CBL-7645 for changing the behavior on the other platforms in the future release.
1 parent 3a3cf0e commit 1916819

File tree

1 file changed

+36
-19
lines changed

1 file changed

+36
-19
lines changed

tests/dev_e2e/test_replication_auto_purge.py

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
WaitForDocumentEventEntry,
1818
)
1919
from cbltest.api.syncgateway import DocumentUpdateEntry
20+
from cbltest.responses import ServerVariant
2021

2122

2223
@pytest.mark.min_test_servers(1)
@@ -732,26 +733,42 @@ async def test_filter_removed_access_documents(
732733
self.mark_test_step("""
733734
Check document replications
734735
* `post_1` has access-removed flag set with no error.
735-
* `post_2` has access-removed flag set with WebSocket/403 ("CBL, 10403) error.
736+
* `post_2` has access-removed flag set with WebSocket/403 ("CBL, 10403) error (except JS)
737+
Note:
738+
* JS doesn't notify document ended notification when documents are rejected
739+
by the pull replication filter. Maybe implemented in the future based on demands.
740+
See CBL-7246 for more details
736741
""")
737-
await repl2.wait_for_all_doc_events(
738-
{
739-
WaitForDocumentEventEntry(
740-
"_default.posts",
741-
"post_1",
742-
ReplicatorType.PULL,
743-
ReplicatorDocumentFlags.ACCESS_REMOVED,
744-
),
745-
WaitForDocumentEventEntry(
746-
"_default.posts",
747-
"post_2",
748-
ReplicatorType.PULL,
749-
ReplicatorDocumentFlags.ACCESS_REMOVED,
750-
"CBL",
751-
10403,
752-
),
753-
}
754-
)
742+
if (await cblpytest.test_servers[0].get_info()).variant != ServerVariant.JS:
743+
await repl2.wait_for_all_doc_events(
744+
{
745+
WaitForDocumentEventEntry(
746+
"_default.posts",
747+
"post_1",
748+
ReplicatorType.PULL,
749+
ReplicatorDocumentFlags.ACCESS_REMOVED,
750+
),
751+
WaitForDocumentEventEntry(
752+
"_default.posts",
753+
"post_2",
754+
ReplicatorType.PULL,
755+
ReplicatorDocumentFlags.ACCESS_REMOVED,
756+
"CBL",
757+
10403,
758+
),
759+
}
760+
)
761+
else:
762+
await repl2.wait_for_all_doc_events(
763+
{
764+
WaitForDocumentEventEntry(
765+
"_default.posts",
766+
"post_1",
767+
ReplicatorType.PULL,
768+
ReplicatorDocumentFlags.ACCESS_REMOVED,
769+
)
770+
}
771+
)
755772

756773
self.mark_test_step("""
757774
Check the local docs

0 commit comments

Comments
 (0)