Skip Menu |

This queue is for tickets about the circle-be CPAN distribution.

Report information
The Basics
Id: 101151
Status: resolved
Priority: 0/
Queue: circle-be

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.142470
  • 0.170740
Fixed in: 0.173320



Subject: Can't use an undefined value as a subroutine reference
The test suite started to fail at 2014-10-18 (see http://matrix.cpantesters.org/?dist=circle-be%200.142470;reports=1#sl=7,1 for a time-sorted list of test reports). A sample fail report: http://www.cpantesters.org/cpan/report/ab2af388-8a1f-11e4-96ae-d196dfbfc7aa
On 2014-12-27 04:44:18, SREZIC wrote: Show quoted text
> The test suite started to fail at 2014-10-18 (see > http://matrix.cpantesters.org/?dist=circle- > be%200.142470;reports=1#sl=7,1 for a time-sorted list of test > reports). A sample fail report: > http://www.cpantesters.org/cpan/report/ab2af388-8a1f-11e4-96ae- > d196dfbfc7aa
Probably caused by IO::Async. Tests were fine until IO::Async 0.63 and started to fail with 0.64. See: http://analysis.cpantesters.org/reports_by_field?distv=circle-be-0.142470;field=mod%3AIO%3A%3AAsync%3A%3ALoop
On 2015-04-11 04:54:36, SREZIC wrote: Show quoted text
> On 2014-12-27 04:44:18, SREZIC wrote:
> > The test suite started to fail at 2014-10-18 (see > > http://matrix.cpantesters.org/?dist=circle- > > be%200.142470;reports=1#sl=7,1 for a time-sorted list of test > > reports). A sample fail report: > > http://www.cpantesters.org/cpan/report/ab2af388-8a1f-11e4-96ae- > > d196dfbfc7aa
> > Probably caused by IO::Async. Tests were fine until IO::Async 0.63 and > started to fail with 0.64. See: > http://analysis.cpantesters.org/reports_by_field?distv=circle-be- > 0.142470;field=mod%3AIO%3A%3AAsync%3A%3ALoop
Similar failures with the current release circle-be-0.170740: ... Use of uninitialized value in subroutine entry at /usr/home/eserte/.cpan/build/2017031615/circle-be-0.170740-4/blib/lib/Circle.pm line 68. Use of uninitialized value in subroutine entry at /usr/home/eserte/.cpan/build/2017031615/circle-be-0.170740-4/blib/lib/Circle.pm line 68. Can't use string ("") as a subroutine ref while "strict refs" in use at /usr/home/eserte/.cpan/build/2017031615/circle-be-0.170740-4/blib/lib/Circle.pm line 68. # Looks like your test exited with 29 before it could output anything. t/01rootobj.t .. Dubious, test returned 29 (wstat 7424, 0x1d00) Failed 13/13 subtests ...
Patch for the IO::Async new_handle change, this also fixes some test issues due to Tangence API changes.
Subject: 2017-06-25-circle-handle-constructor.patch
commit 7ec3a8c329129d589a9786503197f2f67c232ded Author: tom <TEAM@cpan.org> Date: Sun Jun 25 02:20:55 2017 +0800 Fix IO::Async-usage and tests diff --git a/lib/Circle.pm b/lib/Circle.pm index 3eaf68c..910cbb0 100644 --- a/lib/Circle.pm +++ b/lib/Circle.pm @@ -65,7 +65,7 @@ sub make_local_client # Internal hackery; stolen from IaListener my $acceptor = $self->acceptor; - my $handle = $self->{new_handle}->( $self ); + my $handle = $self->{handle_constructor}->( $self ); $S1->blocking( 0 ); $handle->set_handle( $S1 ); $self->on_accept( $handle ); diff --git a/t/01rootobj.t b/t/01rootobj.t index 153889c..5bb662c 100644 --- a/t/01rootobj.t +++ b/t/01rootobj.t @@ -32,23 +32,17 @@ my $widgets = get_widgetset_from $rootobj; ok( my $scroller = $widgets->{"Circle.Widget.Scroller"}, 'Found a Scroller widget' ); ok( my $entry = $widgets->{"Circle.Widget.Entry"}, 'Found an Entry widget' ); -my $watching; my $displayevents; $scroller->watch_property( - property => "displayevents", + "displayevents", on_updated => sub { $displayevents = $_[0] }, - on_watched => sub { $watching++ }, -); - -wait_for { $watching }; +)->get; my $time_before = time; $entry->call_method( - method => "enter", - args => [ "/eval 1" ], - on_result => sub { }, -); + enter => "/eval 1" +)->get; wait_for { $displayevents }; @@ -65,10 +59,8 @@ is_deeply( $event->[2], { text => "Result: 1" }, '$event args' ); undef $displayevents; $rootobj->call_method( - method => "do_command", - args => [ "eval 1" ], - on_result => sub { }, -); + do_command => "eval 1" +)->get; wait_for { $displayevents }; diff --git a/t/02session.t b/t/02session.t index 613d712..5b85fc1 100644 --- a/t/02session.t +++ b/t/02session.t @@ -23,11 +23,10 @@ my $session = get_session $rootobj; ok( $session->proxy_isa( "Circle.Session.Tabbed" ), '$session proxy isa Circle.Session.Tabbed' ); my $tabs; -$session->watch_property( - property => "tabs", - want_initial => 1, +$session->watch_property_with_initial( + "tabs", on_updated => sub { $tabs = $_[0] }, -); +)->get; wait_for { $tabs }; diff --git a/t/50net-raw.t b/t/50net-raw.t index ef6da73..445e1cd 100644 --- a/t/50net-raw.t +++ b/t/50net-raw.t @@ -22,23 +22,17 @@ my $session = get_session $rootobj; send_command $rootobj, "networks add -type raw Test"; -my $rawnet; -$session->get_property( - property => "tabs", - on_value => sub { - $rawnet = $_[0]->[1], - defined $rawnet or die "Expected a tab [1] didn't get one"; - }, -); -wait_for { defined $rawnet }; - +my ($rawnet) = $session->get_property( + "tabs", +)->get->[1]; +defined $rawnet or die "Expected a tab [1] didn't get one"; ok( $rawnet->proxy_isa( "Circle.Net.Raw" ), '$rawnet proxy isa Circle.Net.Raw' ); my $connected_args; $rawnet->subscribe_event( - event => "connected", + "connected", on_fire => sub { $connected_args = [ @_ ] }, -); +)->get; my $widgets = get_widgetset_from $rawnet; @@ -87,28 +81,22 @@ $serverstream->configure( $loop->add( $serverstream ); $widgets->{"Circle.Widget.Entry"}->call_method( - method => "enter", - args => [ "Hello, server!" ], - on_result => sub { }, -); + enter => "Hello, server!" +)->get; wait_for { @lines_from_client }; is( shift @lines_from_client, "Hello, server!", 'client can send to server' ); -my $watching; my @displayevents; $widgets->{"Circle.Widget.Scroller"}->watch_property( - property => "displayevents", + "displayevents", on_set => sub {}, on_push => sub { push @displayevents, @_; }, on_shift => sub {}, - on_watched => sub { $watching++ }, -); - -wait_for { $watching }; +)->get; my $time_before = time; diff --git a/t/CircleTest.pm b/t/CircleTest.pm index 7c02901..6c9815d 100644 --- a/t/CircleTest.pm +++ b/t/CircleTest.pm @@ -23,14 +23,9 @@ sub get_session { my ( $rootobj ) = @_; - my $session; - $rootobj->call_method( - method => "get_session", - args => [ [qw( tabs )] ], - on_result => sub { $session = $_[0] }, - ); - - wait_for { $session }; + my ($session) = $rootobj->call_method( + get_session => [qw( tabs )] + )->get; return $session; } @@ -39,14 +34,9 @@ sub get_widget_from { my ( $windowitem ) = @_; - my $widget; - $windowitem->call_method( - method => "get_widget", - on_result => sub { $widget = $_[0] }, - on_error => sub { die "Test failed early - $_[-1]" }, - ); - - wait_for { $widget }; + my ($widget) = $windowitem->call_method( + 'get_widget' + )->get; return $widget; } @@ -77,15 +67,9 @@ sub send_command { my ( $windowitem, $command ) = @_; - my $done; $windowitem->call_method( - method => "do_command", - args => [ $command ], - on_result => sub { $done = 1 }, - on_error => sub { die "Test failed early - $_[-1]" }, - ); - - wait_for { $done }; + do_command => $command, + )->get; } 0x55AA;
Applied. -- Paul Evans
Released in 0.173320 -- Paul Evans