retupmoca / P6-Net-AMQP

MIT License
6 stars 4 forks source link

Tests failing when vow is broken on done #19

Closed klausweiss closed 6 years ago

klausweiss commented 6 years ago

I couldn't install the library using zef: zef install Net::AMQP

I've cloned the repo and couldn't get it to pass tests:

===> Testing: Net::AMQP:ver<0.1.10>:auth<github:retupmoca>
An operation first awaited:
  in block <unit> at t/05-channel.t line 57

Died with the exception:
    done
      in block <unit> at t/05-channel.t line 57

An operation first awaited:
  in block <unit> at t/10-exchange.t line 55

Died with the exception:
    done
      in block <unit> at t/10-exchange.t line 55

An operation first awaited:
  in block <unit> at t/15-queue.t line 62

Died with the exception:
    done
      in block <unit> at t/15-queue.t line 62

An operation first awaited:
  in block <unit> at t/31-tutorial-one.t line 21

Died with the exception:
    done
      in block <unit> at t/31-tutorial-one.t line 21

An operation first awaited:
  in block <unit> at t/32-tutorial-two.t line 19

Died with the exception:
    done
      in block <unit> at t/32-tutorial-two.t line 19

An operation first awaited:
  in block  at t/40-issue-17.t line 25
  in block <unit> at t/40-issue-17.t line 14

Died with the exception:
    done
      in block  at t/40-issue-17.t line 25
      in block <unit> at t/40-issue-17.t line 14

===> Testing [FAIL]: Net::AMQP:ver<0.1.10>:auth<github:retupmoca>

Aborting due to test failure: Net::AMQP:ver<0.1.10>:auth<github:retupmoca> (use --force-test to override)
  in code  at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 374
  in method test at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 354
  in sub MAIN at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/81436475BD18D66BFD96BBCEE07CCCDC0F368879 (Zef::CLI) line 38
  in block <unit> at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/resources/D822DF07A6D5CB602F97ED307F62A1B3B5D2C90D line 3
  in sub MAIN at /home/klaus/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2
  in block <unit> at /home/klaus/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2

I'm new to both perl6 and this library and I understand a little in this terms, but I finally got to install it with zef install . when changing lib/AMQP.pm6#165 from

$!vow.break("done");

to

$!vow.keep("done");

I've also managed to successfully run consumer/producer example from examples/printer.pl6 and examples/sender.pl6 using the library built in said way.

I'm using Debian 9.3 stretch with kernel 4.9.0-4-amd64.

If I'm doing something wrong, correct me, please. I hope that I have helped.

jonathanstowe commented 6 years ago

Hi, I'm not seeing that particular failure, having confused myself with having a different version of the code than is actually released, the code in github is passing all the tests for me.

Could you let us know which version of Rakudo you have? (the output of perl6 -v) and the version of RabbitMQ server (or whatever it is you are testing against.)

klausweiss commented 6 years ago

Sure. perl6 -v output:

This is Rakudo version 2018.03-227-g914218744 built on MoarVM version 2018.03-100-g96e432da0
implementing Perl 6.c.

I'm using RabbitMQ server from rabbitmq docker image which runs version 3.7.4. Starting with the following command:

docker run -d -p 15672:15672 -p 5672:5672 --name rabbitmq rabbitmq:3-management

RabbitMQ starting logs:

2018-04-14 14:48:21.993 [info] <0.33.0> Application lager started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.442 [info] <0.33.0> Application mnesia started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.442 [info] <0.33.0> Application recon started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.443 [info] <0.33.0> Application jsx started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.451 [info] <0.33.0> Application os_mon started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.451 [info] <0.33.0> Application xmerl started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.572 [info] <0.33.0> Application inets started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.572 [info] <0.33.0> Application asn1 started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.572 [info] <0.33.0> Application crypto started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.572 [info] <0.33.0> Application public_key started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.572 [info] <0.33.0> Application cowlib started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.651 [info] <0.33.0> Application ssl started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.658 [info] <0.33.0> Application ranch started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.661 [info] <0.33.0> Application cowboy started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.661 [info] <0.33.0> Application ranch_proxy_protocol started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.662 [info] <0.33.0> Application rabbit_common started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.673 [info] <0.33.0> Application amqp_client started on node rabbit@112cf795e1d3
2018-04-14 14:48:22.686 [info] <0.193.0> 
 Starting RabbitMQ 3.7.4 on Erlang 20.2.4
 Copyright (C) 2007-2018 Pivotal Software, Inc.
 Licensed under the MPL.  See http://www.rabbitmq.com/

  ##  ##
  ##  ##      RabbitMQ 3.7.4. Copyright (C) 2007-2018 Pivotal Software, Inc.
  ##########  Licensed under the MPL.  See http://www.rabbitmq.com/
  ######  ##
  ##########  Logs: <stdout>

              Starting broker...
2018-04-14 14:48:22.708 [info] <0.193.0> 
 node           : rabbit@112cf795e1d3
 home dir       : /var/lib/rabbitmq
 config file(s) : /etc/rabbitmq/rabbitmq.conf
 cookie hash    : +McMyuI1vh0zttcdsLztRg==
 log(s)         : <stdout>
 database dir   : /var/lib/rabbitmq/mnesia/rabbit@112cf795e1d3
2018-04-14 14:48:25.834 [info] <0.201.0> Memory high watermark set to 3089 MiB (3239126630 bytes) of 7722 MiB (8097816576 bytes) total
2018-04-14 14:48:25.841 [info] <0.203.0> Enabling free disk space monitoring
2018-04-14 14:48:25.841 [info] <0.203.0> Disk free limit set to 50MB
2018-04-14 14:48:25.846 [info] <0.205.0> Limiting to approx 1048476 file handles (943626 sockets)
2018-04-14 14:48:25.846 [info] <0.206.0> FHC read buffering:  OFF
2018-04-14 14:48:25.846 [info] <0.206.0> FHC write buffering: ON
2018-04-14 14:48:25.848 [info] <0.193.0> Node database directory at /var/lib/rabbitmq/mnesia/rabbit@112cf795e1d3 is empty. Assuming we need to join an existing cluster or initialise from scratch...
2018-04-14 14:48:25.848 [info] <0.193.0> Configured peer discovery backend: rabbit_peer_discovery_classic_config
2018-04-14 14:48:25.848 [info] <0.193.0> Will try to lock with peer discovery backend rabbit_peer_discovery_classic_config
2018-04-14 14:48:25.848 [info] <0.193.0> Peer discovery backend does not support locking, falling back to randomized delay
2018-04-14 14:48:25.848 [info] <0.193.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping randomized startup delay.
2018-04-14 14:48:25.848 [info] <0.193.0> All discovered existing cluster peers: 
2018-04-14 14:48:25.849 [info] <0.193.0> Discovered no peer nodes to cluster with
2018-04-14 14:48:25.853 [info] <0.33.0> Application mnesia exited with reason: stopped
2018-04-14 14:48:25.875 [info] <0.33.0> Application mnesia started on node rabbit@112cf795e1d3
2018-04-14 14:48:25.991 [info] <0.193.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
2018-04-14 14:48:26.033 [info] <0.193.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
2018-04-14 14:48:26.079 [info] <0.193.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
2018-04-14 14:48:26.079 [info] <0.193.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping registration.
2018-04-14 14:48:26.081 [info] <0.193.0> Priority queues enabled, real BQ is rabbit_variable_queue
2018-04-14 14:48:26.089 [info] <0.376.0> Starting rabbit_node_monitor
2018-04-14 14:48:26.129 [info] <0.193.0> message_store upgrades: 1 to apply
2018-04-14 14:48:26.129 [info] <0.193.0> message_store upgrades: Applying rabbit_variable_queue:move_messages_to_vhost_store
2018-04-14 14:48:26.130 [info] <0.193.0> message_store upgrades: No durable queues found. Skipping message store migration
2018-04-14 14:48:26.130 [info] <0.193.0> message_store upgrades: Removing the old message store data
2018-04-14 14:48:26.130 [info] <0.193.0> message_store upgrades: All upgrades applied successfully
2018-04-14 14:48:26.171 [info] <0.193.0> Management plugin: using rates mode 'basic'
2018-04-14 14:48:26.172 [info] <0.193.0> Adding vhost '/'
2018-04-14 14:48:26.201 [info] <0.410.0> Making sure data directory '/var/lib/rabbitmq/mnesia/rabbit@112cf795e1d3/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists
2018-04-14 14:48:26.209 [info] <0.410.0> Starting message stores for vhost '/'
2018-04-14 14:48:26.209 [info] <0.414.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index
2018-04-14 14:48:26.211 [info] <0.410.0> Started message store of type transient for vhost '/'
2018-04-14 14:48:26.212 [info] <0.417.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index
2018-04-14 14:48:26.213 [warning] <0.417.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": rebuilding indices from scratch
2018-04-14 14:48:26.214 [info] <0.410.0> Started message store of type persistent for vhost '/'
2018-04-14 14:48:26.216 [info] <0.193.0> Creating user 'guest'
2018-04-14 14:48:26.221 [info] <0.193.0> Setting user tags for user 'guest' to [administrator]
2018-04-14 14:48:26.226 [info] <0.193.0> Setting permissions for 'guest' in '/' to '.*', '.*', '.*'
2018-04-14 14:48:26.234 [info] <0.455.0> started TCP Listener on [::]:5672
2018-04-14 14:48:26.240 [info] <0.193.0> Setting up a table for connection tracking on this node: tracked_connection_on_node_rabbit@112cf795e1d3
2018-04-14 14:48:26.246 [info] <0.193.0> Setting up a table for per-vhost connection counting on this node: tracked_connection_per_vhost_on_node_rabbit@112cf795e1d3
2018-04-14 14:48:26.247 [info] <0.33.0> Application rabbit started on node rabbit@112cf795e1d3
2018-04-14 14:48:26.252 [info] <0.33.0> Application rabbitmq_management_agent started on node rabbit@112cf795e1d3
2018-04-14 14:48:26.252 [info] <0.33.0> Application rabbitmq_web_dispatch started on node rabbit@112cf795e1d3
2018-04-14 14:48:26.294 [info] <0.512.0> Management plugin started. Port: 15672
2018-04-14 14:48:26.294 [info] <0.618.0> Statistics database started.
2018-04-14 14:48:26.295 [info] <0.33.0> Application rabbitmq_management started on node rabbit@112cf795e1d3
2018-04-14 14:48:26.491 [info] <0.5.0> Server startup complete; 3 plugins started.
 * rabbitmq_management
 * rabbitmq_web_dispatch
 * rabbitmq_management_agent
 completed with 3 plugins.

Logs following startup logs after running zef test . on tag v.0.1.10:

2018-04-14 14:49:48.532 [info] <0.658.0> accepting AMQP connection <0.658.0> (172.17.0.1:34570 -> 172.17.0.2:5672)
2018-04-14 14:49:48.846 [info] <0.658.0> connection <0.658.0> (172.17.0.1:34570 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:48.873 [info] <0.658.0> closing AMQP connection <0.658.0> (172.17.0.1:34570 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:49.545 [info] <0.669.0> accepting AMQP connection <0.669.0> (172.17.0.1:34574 -> 172.17.0.2:5672)
2018-04-14 14:49:49.850 [info] <0.669.0> connection <0.669.0> (172.17.0.1:34574 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:49.946 [info] <0.669.0> closing AMQP connection <0.669.0> (172.17.0.1:34574 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:50.566 [info] <0.684.0> accepting AMQP connection <0.684.0> (172.17.0.1:34578 -> 172.17.0.2:5672)
2018-04-14 14:49:50.834 [info] <0.684.0> connection <0.684.0> (172.17.0.1:34578 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:51.052 [info] <0.684.0> closing AMQP connection <0.684.0> (172.17.0.1:34578 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:51.873 [info] <0.705.0> accepting AMQP connection <0.705.0> (172.17.0.1:34586 -> 172.17.0.2:5672)
2018-04-14 14:49:52.186 [info] <0.705.0> connection <0.705.0> (172.17.0.1:34586 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:52.477 [info] <0.705.0> closing AMQP connection <0.705.0> (172.17.0.1:34586 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:53.325 [info] <0.740.0> accepting AMQP connection <0.740.0> (172.17.0.1:34590 -> 172.17.0.2:5672)
2018-04-14 14:49:53.578 [info] <0.740.0> connection <0.740.0> (172.17.0.1:34590 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:54.336 [info] <0.740.0> closing AMQP connection <0.740.0> (172.17.0.1:34590 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:54.912 [info] <0.783.0> accepting AMQP connection <0.783.0> (172.17.0.1:34594 -> 172.17.0.2:5672)
2018-04-14 14:49:55.186 [info] <0.783.0> connection <0.783.0> (172.17.0.1:34594 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:55.207 [info] <0.783.0> closing AMQP connection <0.783.0> (172.17.0.1:34594 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:55.791 [info] <0.792.0> accepting AMQP connection <0.792.0> (172.17.0.1:34598 -> 172.17.0.2:5672)
2018-04-14 14:49:56.042 [info] <0.792.0> connection <0.792.0> (172.17.0.1:34598 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:56.069 [info] <0.792.0> closing AMQP connection <0.792.0> (172.17.0.1:34598 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:57.029 [info] <0.802.0> accepting AMQP connection <0.802.0> (172.17.0.1:34602 -> 172.17.0.2:5672)
2018-04-14 14:49:57.330 [info] <0.802.0> connection <0.802.0> (172.17.0.1:34602 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:57.359 [info] <0.802.0> closing AMQP connection <0.802.0> (172.17.0.1:34602 -> 172.17.0.2:5672, vhost: '/', user: 'guest')
2018-04-14 14:49:57.365 [info] <0.811.0> accepting AMQP connection <0.811.0> (172.17.0.1:34606 -> 172.17.0.2:5672)
2018-04-14 14:49:57.534 [info] <0.811.0> connection <0.811.0> (172.17.0.1:34606 -> 172.17.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2018-04-14 14:49:57.656 [info] <0.811.0> closing AMQP connection <0.811.0> (172.17.0.1:34606 -> 172.17.0.2:5672, vhost: '/', user: 'guest')

zef test . output:

Testing: Net::AMQP:ver<0.1.10>:auth<github:retupmoca>
# Failed test 'Also affects initial connection promise'
# at t/01-connect.t line 28
# expected: 'Kept'
#      got: 'Broken'
# Looks like you failed 1 test of 4
An operation first awaited:
  in block <unit> at t/10-exchange.t line 55

Died with the exception:
    done
      in block <unit> at t/10-exchange.t line 55

An operation first awaited:
  in block <unit> at t/20-integration.t line 118

Died with the exception:
    done
      in block <unit> at t/20-integration.t line 118

An operation first awaited:
  in block <unit> at t/31-tutorial-one.t line 21

Died with the exception:
    done
      in block <unit> at t/31-tutorial-one.t line 21

An operation first awaited:
  in block <unit> at t/32-tutorial-two.t line 19

Died with the exception:
    done
      in block <unit> at t/32-tutorial-two.t line 19

An operation first awaited:
  in block  at t/40-issue-17.t line 26
  in block <unit> at t/40-issue-17.t line 14

Died with the exception:
    done
      in block  at t/40-issue-17.t line 26
      in block <unit> at t/40-issue-17.t line 14

===> 
Testing [FAIL]: Net::AMQP:ver<0.1.10>:auth<github:retupmoca>
Aborting due to test failure: Net::AMQP:ver<0.1.10>:auth<github:retupmoca> (use --force-test to override)
  in code  at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 374
  in method test at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 354
  in sub MAIN at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/81436475BD18D66BFD96BBCEE07CCCDC0F368879 (Zef::CLI) line 38
  in block <unit> at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/resources/D822DF07A6D5CB602F97ED307F62A1B3B5D2C90D line 3
  in sub MAIN at /home/klaus/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2
  in block <unit> at /home/klaus/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2

The output is different, when zef test . is run for the second time:

===> Testing: Net::AMQP:ver<0.1.10>:auth<github:retupmoca>
An operation first awaited:
  in block <unit> at t/01-connect.t line 26

Died with the exception:
    done
      in block <unit> at t/01-connect.t line 26

# Looks like you planned 4 tests, but ran 2
An operation first awaited:
  in block <unit> at t/10-exchange.t line 55

Died with the exception:
    done
      in block <unit> at t/10-exchange.t line 55

An operation first awaited:
  in block <unit> at t/15-queue.t line 62

Died with the exception:
    done
      in block <unit> at t/15-queue.t line 62

An operation first awaited:
  in block <unit> at t/20-integration.t line 118

Died with the exception:
    done
      in block <unit> at t/20-integration.t line 118

An operation first awaited:
  in block <unit> at t/31-tutorial-one.t line 21

Died with the exception:
    done
      in block <unit> at t/31-tutorial-one.t line 21

An operation first awaited:
  in block <unit> at t/32-tutorial-two.t line 68

Died with the exception:
    done
      in block <unit> at t/32-tutorial-two.t line 68

An operation first awaited:
  in sub check-rabbit at /home/klaus/tmp/P6-Net-AMQP/t/lib/RabbitHelper.pm (RabbitHelper) line 15
  in block <unit> at t/40-issue-17.t line 14

Died with the exception:
    done
      in sub check-rabbit at /home/klaus/tmp/P6-Net-AMQP/t/lib/RabbitHelper.pm (RabbitHelper) line 15
      in block <unit> at t/40-issue-17.t line 14

===> Testing [FAIL]: Net::AMQP:ver<0.1.10>:auth<github:retupmoca>
Aborting due to test failure: Net::AMQP:ver<0.1.10>:auth<github:retupmoca> (use --force-test to override)
  in code  at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 374
  in method test at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/8244C3B17ACA61B0EC04857BB3283A8FAF7A186D (Zef::Client) line 354
  in sub MAIN at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/sources/81436475BD18D66BFD96BBCEE07CCCDC0F368879 (Zef::CLI) line 38
  in block <unit> at /home/klaus/.rakudobrew/moar-master/install/share/perl6/site/resources/D822DF07A6D5CB602F97ED307F62A1B3B5D2C90D line 3
  in sub MAIN at /home/klaus/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2
  in block <unit> at /home/klaus/.rakudobrew/bin/../moar-master/install/share/perl6/site/bin/zef line 2
jonathanstowe commented 6 years ago

Well, that's interesting. You did indeed identify the cause of the problem, having updated my Rakudo to somethimg that approximates yours it does fail. Weirdly I think that would always have been wrong but the "done" handler was never being called on the socket connection to the server in older versions of Rakudo, so we'll putit down to be broken by a bug-fix.

If you send your change as a PR I'll apply it and make a release.

Thanks for your help.

klausweiss commented 6 years ago

That's interesting indeed. I'm glad I could help. The PR is open.

jonathanstowe commented 6 years ago

Just released v0.1.11 which has this and another fix in. Please check and close if you're happy.

Thanks again for your help.

klausweiss commented 6 years ago

I'm confused about the second repository. zef recognizes this repository as the source for the Net::AMQP package, not jonathanstowe/P6-Net-AMQP (as stated on modules.perl.org). That's why zef install Net::AMQP still fails on testing.

jonathanstowe commented 6 years ago

Gah, forgot to push to the proper remote. I should delete my own fork, but it should be fine now.

klausweiss commented 6 years ago

Works perfectly. Thanks! (: