def test_mine_send_tries(req_channel_factory):
    channel_enter = MagicMock()
    channel_enter.send.side_effect = lambda load, timeout, tries: tries
    channel = MagicMock()
    channel.__enter__.return_value = channel_enter
    req_channel_factory.return_value = channel

    opts = {
        "random_startup_delay": 0,
        "grains": {},
        "return_retry_tries": 20,
        "minion_sign_messages": False,
    }
    with patch("salt.loader.grains"):
        minion = salt.minion.Minion(opts)
        minion.tok = "token"

        data = {}
        tag = "tag"

        rtn = minion._mine_send(tag, data)
        assert rtn == 20