@@ -0,0 +1,2868 @@
+import asyncio%0Aimport collections%0Aimport logging%0Aimport os%0Aimport unittest%0A%0Aimport pytest%0A%0Afrom integration_tests.env_variable_names import SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN, %5C%0A    SLACK_SDK_TEST_RTM_TEST_CHANNEL_ID%0Afrom integration_tests.helpers import async_test%0Afrom slack import RTMClient, WebClient%0A%0A%0Aclass TestRTMClient_Issue_611(unittest.TestCase):%0A    %22%22%22Runs integration tests with real Slack API%0A%0A    https://github.com/slackapi/python-slackclient/issues/611%0A    %22%22%22%0A%0A    def setUp(self):%0A        self.logger = logging.getLogger(__name__)%0A        self.bot_token = os.environ%5BSLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN%5D%0A%0A    def tearDown(self):%0A        # Reset the decorators by @RTMClient.run_on%0A        RTMClient._callbacks = collections.defaultdict(list)%0A%0A    @pytest.mark.skip() # TODO: Fix this%0A    @async_test%0A    async def test_issue_611(self):%0A        channel_id = os.environ%5BSLACK_SDK_TEST_RTM_TEST_CHANNEL_ID%5D%0A        text = %22This message was sent by %3Chttps://slack.dev/python-slackclient/%7Cpython-slackclient%3E! (test_issue_611)%22%0A%0A        self.message_count, self.reaction_count = 0, 0%0A%0A        def process_messages(**payload):%0A            self.logger.info(payload)%0A            if %22subtype%22 in payload%5B%22data%22%5D and payload%5B%22data%22%5D%5B%22subtype%22%5D == %22message_replied%22:%0A                return  # skip%0A%0A            self.message_count += 1%0A            raise Exception # This causes the termination of the process%0A%0A        def process_reactions(**payload):%0A            self.logger.info(payload)%0A            self.reaction_count += 1%0A%0A        rtm = RTMClient(token=self.bot_token, run_async=True)%0A        RTMClient.on(event='message', callback=process_messages)%0A        RTMClient.on(event='reaction_added', callback=process_reactions)%0A%0A        web_client = WebClient(token=self.bot_token, run_async=True)%0A        message = await web_client.chat_postMessage(channel=channel_id, text=text)%0A        ts = message%5B%22ts%22%5D%0A%0A        await asyncio.sleep(3)%0A%0A        # intentionally not waiting here%0A        rtm.start()%0A%0A        try:%0A            await asyncio.sleep(3)%0A%0A            first_reaction = await web_client.reactions_add(channel=channel_id, timestamp=ts, name=%22eyes%22)%0A            self.assertFalse(%22error%22 in first_reaction)%0A            await asyncio.sleep(2)%0A%0A            should_be_ignored = await web_client.chat_postMessage(channel=channel_id, text=%22Hello?%22, thread_ts=ts)%0A            self.assertFalse(%22error%22 in should_be_ignored)%0A            await asyncio.sleep(2)%0A%0A            second_reaction = await web_client.reactions_add(channel=channel_id, timestamp=ts, name=%22tada%22)%0A            self.assertFalse(%22error%22 in second_reaction)%0A            await asyncio.sleep(2)%0A%0A            self.assertEqual(self.message_count, 1)%0A            self.assertEqual(self.reaction_count, 2)  # TODO: fix this%0A        finally:%0A            if rtm._stopped:%0A                rtm.stop()%0A

Add a test case for #611