question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Demultiplexer testing with enforcing order

See original GitHub issue

Channels 1.1.1

I’m tryign to do a test with a Demultiplexer, and it complains about enforcing ordering. I have the flag set, but do I have to add an order value to every message I send?

class ROSChannelTestCase(ChannelTestCase):
    """
    ROS Channel Test Case
    Test if we can do things
    """

    def test_ros_channel(self):
        client = HttpClient()
        # user = User.objects.create_user(username='test', email='test@test.com', password='123456')
        # client.login(username='test', password='123456')
        with apply_routes([Demultiplexer.as_route(path='/new/')]):
            client.send_and_consume(u'websocket.connect', path='/new/')
            self.assertIsNone(client.receive())

File “/home/cjds/development/robot_configuration_interface/robot_configuration_interface/tests/unit/test_channels.py”, line 35, in test_ros_channel client.send_and_consume(u’websocket.connect’, path=‘/new/’) File “/usr/local/lib/python2.7/dist-packages/channels/test/http.py”, line 95, in send_and_consume return self.consume(channel, fail_on_none=fail_on_none, check_accept=check_accept) File “/usr/local/lib/python2.7/dist-packages/channels/test/http.py”, line 98, in consume result = super(HttpClient, self).consume(channel, fail_on_none=fail_on_none) File “/usr/local/lib/python2.7/dist-packages/channels/test/base.py”, line 136, in consume return consumer(message, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/generic/base.py”, line 32, in init self.dispatch(message, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/generic/base.py”, line 70, in dispatch return self.get_handler(message, **kwargs)(message, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/sessions.py”, line 78, in inner return func(*args, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/auth.py”, line 42, in inner return func(message, *args, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/generic/websockets.py”, line 68, in raw_connect self.connect(message, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/generic/websockets.py”, line 275, in connect consumer(message, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/generic/base.py”, line 32, in init self.dispatch(message, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/generic/base.py”, line 70, in dispatch return self.get_handler(message, **kwargs)(message, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/sessions.py”, line 54, in inner return func(*args, **kwargs) File “/usr/local/lib/python2.7/dist-packages/channels/sessions.py”, line 125, in inner “can only be used on messages containing it.” ValueError: No order value in message; @enforce_ordering can only be used on messages containing it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Krukovcommented, Apr 16, 2017

@andrewgodwin maybe HttpClient has bad naming, but it designed to test WebSocket consumers. I can make PR to rename it… @cjds if you test consumers with enforce_ordering you need to add order at message manually:

client.send_and_consume(u'websocket.connect', {'order': 0}, path='/new/')
client.send_and_consume(u'websocket.receive', {'order': 1}, path='/new/')
0reactions
cjdscommented, Apr 4, 2017

A lot of the testing examples seem wrong, if this is not the way it works. I’ll see if I can edit it and improve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Demultiplexer (DEMUX) Digital Decoder Tutorial
Electronics Tutorial about the Demultiplexer (DEMUX) used for Data Distribution in Combinational Logic Circuits including Digital Decoders.
Read more >
The Diamond Queue (Demultiplexer to set of threads to ...
It is important to note that thread A and thread B can be the same thread. The DiamondQueue also supports lanes to enforce...
Read more >
What is a Demultiplexer (Demux)? - Electronics Hub
A Demultiplexer is a combinational logic circuit that receives the information on a single input line and transmits the same information over ...
Read more >
Spectral Demultiplexing in Holographic and Fluorescent On ...
Specifically, we introduce spectral demultiplexing approaches that aim to digitally narrow the spectral content of broadband illumination ...
Read more >
User guide — Cutadapt 4.2 documentation - Read the Docs
The order of adapters is the order in which they are given on the command line or in which they are found in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found