Skip to main content
AndrewZellman
Adobe Employee
Adobe Employee
September 16, 2009
Question

Order of Requests sent to run()

  • September 16, 2009
  • 1 reply
  • 1805 views

I built a custom Array of Request objects (because I needed to do iterative testing) in a specific order using array.push() in this order:

TestA

TestA

TestA

TestB

TestB

TestB

TestC

TestC

TestC

Why does FlexUnit scramble this order?  Shouldn't it read straight through this array?

Thanks for your help,

Zellman

This topic has been closed for replies.

1 reply

brian_thomas2
Adobe Employee
Adobe Employee
September 29, 2009

I'm seeing this same problem with the order of test cases. Any thoughts on why the order of test cases in requests is not consistent?

Thanks!

Brian

Participating Frequently
September 29, 2009

Sorry, missed this original post.

Ordering is not guaranteed by default. It is not guaranteed when you create a testsuite or a test case either, not just with requests. When creating a testSuite or testcase manually, there is an OrderBy metadata attribute that can be added to specify the order.

When you are creating (n) requests and sending them to FlexUnit, there is a suite created on your behalf internally where these Requests are added. Because the ordering of children in suites is also not guaranteed, they become 'scrambled'

While we will likely provide some sort of enhancement where this can be specified for Requests so it is similar to suites, I am not sure when this will occur at this point.

brian_thomas2
Adobe Employee
Adobe Employee
October 6, 2009

Why is ordering not guaranteed?

It's becoming a significant problem for us that we can't rely on our tests to run in a consistent order from run to run. We've seen a few bugs in our code where a test will leave us in a state that will cause subsequent tests to fail. When the run order isn't consistent and cannot be specified, it makes it difficult for us to reproduce errors that happened in previous test runs.

Is there anything we can do or something that can be improved in the framework so at the very least tests run in a consistent order?

Thanks!

Brian