From c66b465c47245a4320d420e5373bfc2185d81c78 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 21 Sep 2022 14:19:56 +0100 Subject: [PATCH] Add some logging to diagnose a flaky test Extra logging to help diagnose https://github.com/matrix-org/synapse/issues/13334 --- tests/direct_messaging_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/direct_messaging_test.go b/tests/direct_messaging_test.go index bad541bd..0a980c11 100644 --- a/tests/direct_messaging_test.go +++ b/tests/direct_messaging_test.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "testing" + "time" "github.com/matrix-org/complement/internal/b" "github.com/matrix-org/complement/internal/client" @@ -19,7 +20,11 @@ import ( // Requires a functioning account data implementation. func TestWriteMDirectAccountData(t *testing.T) { deployment := Deploy(t, b.BlueprintOneToOneRoom) - defer deployment.Destroy(t) + defer func() { + // additional logging to debug https://github.com/matrix-org/synapse/issues/13334 + t.Logf("%s: TestWriteMDirectAccountData complete: destroying HS deployment", time.Now()) + deployment.Destroy(t) + }() alice := deployment.Client(t, "hs1", "@alice:hs1") bob := deployment.Client(t, "hs1", "@bob:hs1") @@ -46,6 +51,7 @@ func TestWriteMDirectAccountData(t *testing.T) { } return true } + t.Logf("%s: global account data set; syncing until it arrives", time.Now()) // synapse#13334 since := alice.MustSyncUntil(t, client.SyncReq{}, client.SyncGlobalAccountDataHas(checkAccountData)) // now update the DM room and test that incremental syncing also pushes new account data roomID = alice.CreateRoom(t, map[string]interface{}{