element-hq / element-hq/synapse

`EventPersisterShardTestCase.test_basic` is flaky

Open
#12,870 0 comments 0 reactions 0 assignees View on GitHub
A-Testing T-Defect T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#12870](https://github.com/matrix-org/synapse/issues/12870).

---

https://github.com/matrix-org/synapse/runs/6588296007?check_suite_focus=true:

```
[FAIL]
Traceback (most recent call last):
File "/home/runner/work/synapse/synapse/tests/replication/test_sharded_event_persister.py", line 119, in test_basic
self.assertTrue(persisted_on_1)
File "/home/runner/.cache/pypoetry/virtualenvs/matrix-synapse-pswDeSvb-py3.10/lib/python3.10/site-packages/twisted/trial/_synctest.py", line 380, in assertTrue
super().assertTrue(condition, msg)
File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/unittest/case.py", line 687, in assertTrue
raise self.failureException(msg)
twisted.trial.unittest.FailTest: False is not true
```

Sadly it looks like we don't keep the logs from `_trial_temp`.

Contributor guide

Open the contributing guide

Research direction

Start with synapse/tests/replication/test_sharded_event_persister.py, especially EventPersisterShardTestCase.test_basic around line 119, and reproduce it with the relevant Trial test command. Trace why persisted_on_1 can remain false and use the failure output as a guide; done means the test reliably passes without masking the underlying replication problem.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.