wagtail / wagtail-vector-index

Store Wagtail pages & Django models as embeddings in vector databases
https://wagtail-vector-index.readthedocs.io/en/latest/
MIT License
18 stars 12 forks source link

Fix flaky tests #8

Closed zerolab closed 9 months ago

zerolab commented 1 year ago

test_get_split_content_splits_longer_content is a bit flaky and sometimes splits == 1 resulting in

    def test_get_split_content_splits_longer_content():
        content_length = 340
        split_length = 200
        body = fake.text(max_nb_chars=content_length)[:content_length]
        instance = ExamplePageFactory.create(title="a", body=body)
        splits = instance._get_split_content(split_length=split_length, split_overlap=0)
>       assert len(splits) == 2
E       AssertionError: assert 1 == 2
E        +  where 1 = len(['a\nPainting right various sort. Western medical cut third of song hotel social. Early young with from form dog hand.\nStyle though rest home shoulder agency. Own use look blue film loss enough.'])

most prononunce in CI, but had it locally a few times

zerolab commented 9 months ago

I believe this was fixed by #24 /cc @tm-kn

tm-kn commented 9 months ago

Haven't seen evidence of tests failing randomly in a while. Closing.