qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DISPATCH-209) Three+ router test is needed in the system test suite.
Date Wed, 04 Jan 2017 22:45:59 GMT

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

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/134#discussion_r94681419
  
    --- Diff: tests/system_tests_three_routers.py ---
    @@ -220,6 +225,70 @@ def run(self):
             Container(self).run()
      
      
    +class DynamicRequestResponseTest(MessagingHandler):
    +    def __init__(self, address1, address2):
    +        super(DynamicRequestResponseTest, self).__init__(prefetch=0)
    +        self.address1   = address1
    +        self.address2   = address2
    +        self.dest       = "closest.dynamicRequestResponse"
    +        self.error      = None
    +        self.sender     = None
    +        self.server_receiver = None
    +        self.client_receiver = None
    +        self.n_expected = 10
    +        self.n_sent     = 0
    +        self.n_received = 0
    +        self.n_accepted = 0
    + 
    +    def timeout(self):
    +        self.error = "Timeout Expired %d messages received." % self.n_received
    +        self.client_connection.close()
    +        self.server_connection.close()
    + 
    +    def on_released(self, event):
    +        self.n_sent -= 1
    +        time.sleep(0.1)
    +
    +    def on_start(self, event):
    +        self.timer = event.reactor.schedule(5, Timeout(self))
    +        self.client_connection = event.container.connect(self.address1)
    +        self.server_connection = event.container.connect(self.address2)
    +        self.server_receiver = event.container.create_receiver(self.server_connection,
self.dest)
    +        self.client_receiver = event.container.create_receiver(self.client_connection,
None, dynamic=True)
    +        self.server_receiver.flow(self.n_expected)
    +        self.client_receiver.flow(self.n_expected)
    +        self.sender = event.container.create_sender(self.client_connection, None)
    + 
    +    def on_sendable(self, event):
    +        if self.n_sent < self.n_expected:
    +            # We send to server, and ask it to reply to client.
    +            request = Message(body=self.n_sent, address=self.dest, reply_to=self.client_receiver.remote_source.address)
    +            event.sender.send(request)
    +            self.n_sent += 1
    + 
    +    def on_accepted(self, event):
    +        self.n_accepted += 1
    + 
    +    def on_message(self, event):
    +
    +        # Receiver gets a message and replies to client.
    +        if event.receiver == self.server_receiver :
    +            self.sender.send ( Message(address=event.message.reply_to, body="Reply hazy,
try again later.") )
    --- End diff --
    
    The server is sending its responses on the client's sender!


> 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
>
> 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.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message