@@ -243,14 +243,28 @@ func (s *testSyncerSuite) TestSampleUnhandledEvents(c *check.C) {
243243 }
244244
245245 c .Assert (seen ["unhandled event" ], check .HasLen , 1 )
246- c .Assert (seen ["unhandled event" ][0 ]["type" ], check .Equals , "*replication.RowsQueryEvent" )
246+ c .Assert (seen ["unhandled event" ][0 ]["events" ], check .DeepEquals , map [string ]int {
247+ "*replication.RowsQueryEvent" : 1 ,
248+ })
247249 c .Assert (seen ["unhandled event from transaction payload" ], check .HasLen , 1 )
248- c .Assert (seen ["unhandled event from transaction payload" ][0 ]["type" ], check .Equals , "*replication.QueryEvent" )
250+ c .Assert (seen ["unhandled event from transaction payload" ][0 ]["events" ], check .DeepEquals , map [string ]int {
251+ "*replication.QueryEvent" : 1 ,
252+ })
249253
250254 syncer .recordUnhandledEvent ("unhandled event" , & replication.RowsQueryEvent {})
251255 syncer .recordUnhandledEvent ("unhandled event" , & replication.QueryEvent {})
252256 syncer .recordUnhandledEvent ("unhandled event from transaction payload" , & replication.QueryEvent {})
253257 c .Assert (logs .All (), check .HasLen , 2 )
258+
259+ syncer .unhandledEvents .Lock ()
260+ defer syncer .unhandledEvents .Unlock ()
261+ c .Assert (syncer .unhandledEvents .counts ["unhandled event" ], check .DeepEquals , map [string ]int {
262+ "*replication.QueryEvent" : 2 ,
263+ "*replication.RowsQueryEvent" : 3 ,
264+ })
265+ c .Assert (syncer .unhandledEvents .counts ["unhandled event from transaction payload" ], check .DeepEquals , map [string ]int {
266+ "*replication.QueryEvent" : 2 ,
267+ })
254268}
255269
256270func mockGetServerUnixTS (mock sqlmock.Sqlmock ) {
0 commit comments