Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POST getting executed twice in throws_like test #3389

Closed
p6rt opened this issue May 21, 2014 · 7 comments
Closed

POST getting executed twice in throws_like test #3389

p6rt opened this issue May 21, 2014 · 7 comments
Labels
JVM Related to Rakudo-JVM

Comments

@p6rt
Copy link

p6rt commented May 21, 2014

Migrated from rt.perl.org#121935 (status was 'resolved')

Searchable as RT121935$

@p6rt
Copy link
Author

p6rt commented May 21, 2014

From @lizmat

[10​:35​:31] <moritz> m​: try eval 'my class A {}; (-> &c, $m { A.new()(); CATCH { default { $m } } } )(A, "")'; say $!.perl
[10​:35​:32] <+camelia> rakudo-moar bc585f​: OUTPUT«X​::TypeCheck​::Binding.new(symbol => "\&c", operation => "binding", got => A, expected => Callable)␤Saw 1 call to deprecated code during execution.␤================================================================================␤Sub eval (from GLOBAL)…»
[10​:38​:52] <moritz> lizmat​: there's something wonky with subtests on the JVM
[10​:39​:03] <moritz> paste forthcoming
[10​:40​:41] <moritz> lizmat​: http://perlpunks.de/paste/show/537c6684.362a.1b5
[10​:53​:55] <lizmat> moritz​: fwiw, it more indicates a problem with POST than with the test itself
[10​:55​:01] <lizmat> and because it gets executed twice, the subtest fails because the number of tests is different from the (sub)plan
[10​:57​:41] <moritz> but isn't it throws_like that executes the test twice?
[10​:58​:09] <moritz> j​: my sub a { POST 0 }; a()
[10​:58​:22] <+camelia> rakudo-jvm bc585f​: OUTPUT«(timeout)»
[10​:58​:34] lizmat is firing up a perl6-j
[10​:59​:36] <moritz> huh, the perl6-j repl prints Postcondition '0' failed twice
[10​:59​:49] <lizmat> so the test failure is correct :-)
[11​:00​:12] <moritz> lizmat​: I still don't understand how throws_like $anything, ...; can make the subtests execute twice
[11​:26​:17] <lizmat> moritz​: looks like the code is only EVALled once, but throwing twice
[11​:29​:58] <lizmat> moritz​: suggest to rakudobug it and fudge for jvm
[11​:33​:18] <lizmat> moritz​: some more datapoints​: it's two different exception objects being thrown
[11​:33​:31] <lizmat> of the same type and content, but with different WHICH
[11​:46​:08] <lizmat> moritz​: more datapoints​: looks like the "exit_handler" is run twice, the number of POST blocks is 1
[11​:46​:20] <lizmat> so the POST block did not get push twice to the phasers
[11​:46​:26] <lizmat> *pushed
[11​:50​:20] <lizmat> marking as rakudobug now

@p6rt
Copy link
Author

p6rt commented Oct 25, 2014

From @usev6

For the records​: This is an example from the command line using "throws_like"​:

$ perl6-j -e 'use Test; my sub a { POST 0 }; throws_like { a() }, X​::Phaser​::PrePost'
  1..2
  ok 1 - code dies
  ok 2 - right exception type (X​::Phaser​::PrePost)
  ok 3 - code dies
  ok 4 - right exception type (X​::Phaser​::PrePost)
  # Looks like you planned 2 tests, but ran 4
not ok 1 - did we throws_like X​::Phaser​::PrePost?

# Failed test 'did we throws_like X​::Phaser​::PrePost?'
# at -e line 1

@p6rt
Copy link
Author

p6rt commented Oct 25, 2014

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 4, 2015

From @donaldh

Fixed by Raku/nqp@54d3cf5d14

@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

From @usev6

I unfudged a now passing test in S32-exceptions/misc.t with commit Raku/roast@b9c046368d

On behalf of donaldh++ I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

From @usev6

I unfudged a now passing test in S32-exceptions/misc.t with commit Raku/roast@b9c046368d

On behalf of donaldh++ I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Mar 10, 2015

@usev6 - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Mar 10, 2015
@p6rt p6rt added the JVM Related to Rakudo-JVM label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JVM Related to Rakudo-JVM
Projects
None yet
Development

No branches or pull requests

1 participant