• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SpiNNakerManchester / SpiNNMan / 6847855649

13 Nov 2023 09:10AM UTC coverage: 51.985% (+0.008%) from 51.977%
6847855649

push

github

web-flow
Merge pull request #380 from SpiNNakerManchester/allow_count_p2p_timeout

Allow count p2p timeout

110 of 1296 branches covered (0.0%)

Branch coverage included in aggregate %.

8 of 23 new or added lines in 4 files covered. (34.78%)

2 existing lines in 2 files now uncovered.

4788 of 8126 relevant lines covered (58.92%)

0.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.0
/spinnman/processes/send_single_command_process.py
1
# Copyright (c) 2015 The University of Manchester
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#     https://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
from typing import Generic, Optional, TypeVar, Set
1✔
15
from .abstract_multi_connection_process import AbstractMultiConnectionProcess
1✔
16
from spinnman.constants import SCP_TIMEOUT
1✔
17
from spinnman.messages.scp.abstract_messages import AbstractSCPResponse
1✔
18
from spinnman.messages.scp.abstract_messages import AbstractSCPRequest
1✔
19
from .abstract_multi_connection_process_connection_selector import (
1✔
20
    ConnectionSelector)
21
from spinnman.messages.scp.enums.scp_result import SCPResult
1✔
22
#: Type of responses.
23
#: :meta private:
24
R = TypeVar("R", bound=AbstractSCPResponse)
1✔
25

26

27
class SendSingleCommandProcess(AbstractMultiConnectionProcess, Generic[R]):
1✔
28
    """
29
    A process that sends a single command and waits for a simple response.
30
    """
31
    __slots__ = ("_response", )
1✔
32

33
    def __init__(self, connection_selector: ConnectionSelector,
1✔
34
                 n_retries: int = 3, timeout: float = SCP_TIMEOUT,
35
                 non_fail_retry_codes: Optional[Set[SCPResult]] = None):
36
        """
37
        :param ConnectionSelector connection_selector:
38
        :param int n_retries:
39
            The number of retries of a message to use. Passed to
40
            :py:class:`SCPRequestPipeLine`
41
        :param float timeout:
42
            The timeout, in seconds. Passed to
43
            :py:class:`SCPRequestPipeLine`
44
        :param Optional[Set[SCPResult]] non_fail_retry_codes:
45
            Optional set of responses that result in retry but after retrying
46
            don't then result in failure even if returned on the last call.
47
        """
48
        super().__init__(
×
49
            connection_selector, n_retries=n_retries, timeout=timeout,
50
            non_fail_retry_codes=non_fail_retry_codes)
UNCOV
51
        self._response: Optional[R] = None
×
52

53
    def __handle_response(self, response: R):
1✔
54
        self._response = response
×
55

56
    def execute(self, request: AbstractSCPRequest[R]) -> R:
1✔
57
        """
58
        :param AbstractSCPRequest request:
59
        :rtype: AbstractSCPResponse
60
        """
61
        with self._collect_responses():
×
62
            self._send_request(request, self.__handle_response)
×
63
        assert self._response is not None
×
64
        return self._response
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc