[jira] [Commented] (DISPATCH-209) Three+ router test is needed in the system test suite.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jira] [Commented] (DISPATCH-209) Three+ router test is needed in the system test suite.

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/DISPATCH-209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048254#comment-16048254 ]

ASF GitHub Bot commented on DISPATCH-209:
-----------------------------------------

Github user ted-ross commented on a diff in the pull request:

    https://github.com/apache/qpid-dispatch/pull/165#discussion_r121760200
 
    --- Diff: tests/system_tests_three_routers.py ---
    @@ -335,36 +417,124 @@ def on_start ( self, event ):
             self.client_receiver   = event.container.create_receiver(self.client_connection, None, dynamic=True)
     
     
    +    def on_sendable ( self, event ):
    +        if event.sender == self.sender :
    +            while event.sender.credit > 0 and self.n_sent < self.n_expected:
    +                # We send to server, and tell it how to reply to the client.
    +                reply_to_addr = self.client_receiver.remote_source.address
     
    -    def on_sendable(self, event):
    -        while event.sender.credit > 0 and self.n_sent < self.n_expected:
    -            # We send to server, and tell it how to reply to the client.
    -            reply_to_addr = self.client_receiver.remote_source.address
    -
    -            request = Message ( body=self.n_sent,
    -                                address=self.dest,
    -                                reply_to = reply_to_addr )
    -            event.sender.send ( request )
    -            self.n_sent += 1
    +                request = Message ( body=self.n_sent,
    +                                    address=self.dest,
    +                                    reply_to = reply_to_addr )
    +                event.sender.send ( request )
    +                self.n_sent += 1
     
     
    -    def on_message(self, event):
    +    def on_message ( self, event ):
             # Server gets a request and responds to
             # the address that is embedded in the message.
             if event.receiver == self.server_receiver :
    -            self.server_sender.send ( Message(address=event.message.reply_to,
    -                                      body="Reply hazy, try again later.") )
    +            # pdb.set_trace()
                 self.received_by_server += 1
    +            msg = Message(address=event.message.reply_to, body="Reply hazy, try again later.")
    +            self.server_sender.send ( msg )
     
             # Client gets a response and counts it.
             elif event.receiver == self.client_receiver :
                 self.received_by_client += 1
                 if self.received_by_client == self.n_expected:
    -                self.timer.cancel()
    -                self.server_receiver.close()
    -                self.client_receiver.close()
    -                self.client_connection.close()
    -                self.server_connection.close()
    +                self.shutdown ( )
    +
    +
    +    def run(self):
    +        Container(self).run()
    +
    +
    +
    +
    +
    +class LinkRoute ( MessagingHandler ):
    +
    +    """
    +        Set up and use a link-route, to send a message this way:
    +            receiver <--- A <--- B <--- C <--- sender
    +    """
    +
    +    def __init__ ( self, addr_listening_for_route_container, linkroute_prefix, qdstat_address, send_address ):
    +        super(LinkRoute, self).__init__(prefetch=0)
    +        self.addr_listening_for_route_container = addr_listening_for_route_container
    +        self.send_address = send_address
    +        self.linkroute_prefix = linkroute_prefix
    +        self.qdstat_address = qdstat_address
    +        self.error      = None
    +        self.send_connection = None
    +        self.recv_connection = None
    +        self.false_statement = "This is not the message you are looking for."
    --- End diff --
   
    For anyone trying to understand how this test works, this text is misleading.


> Three+ router test is needed in the system test suite.
> ------------------------------------------------------
>
>                 Key: DISPATCH-209
>                 URL: https://issues.apache.org/jira/browse/DISPATCH-209
>             Project: Qpid Dispatch
>          Issue Type: New Feature
>          Components: Tests
>            Reporter: Ted Ross
>            Assignee: michael goulish
>             Fix For: 1.0.0
>
>
> There have arisen some issues that would have been caught had there been a three-router test in the regression suite.  This test should be added.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...