From e3119c76f39a30eb7bba3def7b9fffba71b1475a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 2 Mar 2026 10:16:07 -0500 Subject: [PATCH] test: add debug test to see if failing test is due to race condition --- test/topics.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/topics.js b/test/topics.js index 21ecffd245..e9cb2bf1b1 100644 --- a/test/topics.js +++ b/test/topics.js @@ -1423,7 +1423,13 @@ describe('Topic\'s', () => { const result = await topics.post({ uid: adminUid, title: 'deleted unread', content: 'not unread', cid: categoryObj.cid }); await topics.delete(result.topicData.tid, adminUid); const unreadTids = await topics.getUnreadTids({ cid: 0, uid: uid }); - assert(!unreadTids.includes(result.topicData.tid), JSON.stringify({ unreadTids, tid: result.topicData.tid })); + + await sleep(2000); + const _unreadTids = await topics.getUnreadTids({ cid: 0, uid: uid }); + assert( + !unreadTids.includes(result.topicData.tid), + JSON.stringify({ unreadTids, _unreadTids, tid: result.topicData.tid }) + ); }); });