Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-1908

Test functions called N^2 times for a N-sized "where:" block

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • spock_1.0.0.Beta3
    • Spock TestRunner
    • None
    • Hide

      Here is a simple example:

      @RunWith(ArquillianSputnik)
      class MySpec extends Specification{

      @Deployment
      public static Archive<?> "create deployment"()

      { return ShrinkWrap.create(WebArchive.class, "test.war") .addPackage(MySpec.class.getPackage()) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); }

      def test()

      { when: println i; then: i == i; where: i << (1..2); }

      }

      Output:
      13:01:14,287 INFO stdout 1
      13:01:14,350 INFO stdout 2
      13:01:14,689 INFO stdout 1
      13:01:14,778 INFO stdout 2

      Show
      Here is a simple example: @RunWith(ArquillianSputnik) class MySpec extends Specification{ @Deployment public static Archive<?> "create deployment"() { return ShrinkWrap.create(WebArchive.class, "test.war") .addPackage(MySpec.class.getPackage()) .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml"); } def test() { when: println i; then: i == i; where: i << (1..2); } } Output: 13:01:14,287 INFO stdout 1 13:01:14,350 INFO stdout 2 13:01:14,689 INFO stdout 1 13:01:14,778 INFO stdout 2

      Test functions called N^2 times for a "where:" spock block,
      where N is a size of the "where:" block.

      I think the framework iterates twice over the "where: " block.
      First on a client side and then in a container (for each iteration on the client side).

            bartosz-1 Bartosz Majsak
            vladislav_jira Vladislav Mikerin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: