matrix-org / matrix-org/complement

TestOutboundFederationIgnoresMissingEventWithBadJSONForRoomVersion6 causes other tests to be flaky

未关闭
#751 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Go
星标
99
派生
72
平均合并
4 天 1 小时
30 天内合并 PR
8

描述

In my synapse fork, I was seeing consistent flakiness when running complement on GH actions.

These tests were failing

❌ TestFederationKeyUploadQuery (580ms)
❌ TestKnockingInMSC3787Room (570ms)
❌ TestRestrictedRoomsRemoteJoinFailOverInMSC3787Room (6.73s)
❌ TestToDeviceMessagesOverFederation (7.73s)
❌ TestToDeviceMessagesOverFederation/interrupted_connectivity (6.14s)
❌ TestToDeviceMessagesOverFederation/stopped_server (20ms)

When adding debugging, I saw

"""
synapse_main | 2024-12-04 15:52:18,608 - synapse.federation.federation_base - 303 - ERROR - _process_incoming_pdus_in_room_inner-4-$Vp3-8StRMJno4kS-21Sr_LSK47Gk9HS4CIBdOjrsKbk - Invalid canonical JSON: {'auth_events': ['$3TeeAwpC6Edh_I_orHhXdCQLkztifWjjmSd78dU4qS0', '$7hX4UVoc-RUi5_agACZsqfotFvoqWkdwE0DMmiRQDL8', '$-ylJZyK-Hyxn_WOewXKLVD1XnVdAC_p2lxDLqKiG2pM'], 'content': {'bad_val': 1.1, 'body': 'Message 1'}, 'depth': 6, 'hashes': {'sha256': '+PxMZ1aox2NRluRwq0ctXEKXZ2NMsJG0yyKIBl1EQzg'}, 'origin': 'host.docker.internal:38621', 'origin_server_ts': 1733327538532, 'prev_events': ['$PO2EDaOjQOTSYMB0cN588VLhNn3JXUK2tHnLAWeKYG4'], 'room_id': '!0-1WnNO2FKvuc021cNJ3:host.docker.internal:38621', 'sender': '@charlie:host.docker.internal:38621', 'signatures': {'host.docker.internal:38621': {'ed25519:complement_aeff3b6780deb126c603cb94fcaefc9f922ad031cbab161c6f32014bac2354d1': '2Eidd/749jgA9rtwlAg54OENuddfKqY3P9YYBkvcZl5wx43ZhfvdkV9E4tLPwhbKVokwE5mOrs1l8flvjDsHDA'}}, 'type': 'm.room.message'} 400: Bad JSON value: 1.1
"""

This was happening on fetching prev_events
image

I noticed that the only place in complement where bad_val comes from is the test TestOutboundFederationIgnoresMissingEventWithBadJSONForRoomVersion6
https://github.com/matrix-org/complement/blob/fc63446512261a496b794a7082a6598b6f98e925/tests/federation_room_get_missing_events_test.go#L205

by disabling that one test, the rest of my tests started passing.

So it seems like a combination of 1) should synapse be failing on failing to deserialize prev_events? but also 2) why is this one test polluting others in the database? (and, relatedly, how do we isolate it?)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 tests/federation_room_get_missing_events_test.go 中的 TestOutboundFederationIgnoresMissingEventWithBadJSONForRoomVersion6 附近开始,并将该测试与列出的 Complement 测试一起运行。跟踪 bad_val 在哪里进入数据库,以及获取 prev_events 时如何处理它,然后确定隔离或清理边界。当能够复现 flakiness,且受影响的测试不再相互污染时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
go
领域
distributed-systems, testing-qa
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。