Skip to content

Set default test order to alphabetical#10925

Merged
mikeharder merged 1 commit intoAzure:masterfrom
mikeharder:run-order-alphabetical
May 8, 2020
Merged

Set default test order to alphabetical#10925
mikeharder merged 1 commit intoAzure:masterfrom
mikeharder:run-order-alphabetical

Conversation

<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-surefire-plugin;external_dependency} -->
<configuration>
<runOrder>alphabetical</runOrder>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be override by client setting. Storage has its own surefire setting.

Copy link
Member

@alzimmermsft alzimmermsft May 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maven by default merges configuration, since this isn't set in Storage it should use this value. Another question is will Spock respect this configuration.

@JimSuplizio
Copy link
Contributor

I'm not OK with this change and I do not think it should be checked in. Tests should be able to run in any order. If test A fails because test B ran first, then the tests should be fixed, not the ordering.

@mikeharder
Copy link
Member Author

I'm not OK with this change and I do not think it should be checked in. Tests should be able to run in any order. If test A fails because test B ran first, then the tests should be fixed, not the ordering.

Ideally yes, and if we really wanted to enforce this we would set the default to random instead of either alphabetical or the default filesystem, and aggressively disable and fix tests until they all pass consistently. However, random has the downside of non-repeatable builds, so builds may randomly flip from passing to failing due to test order until all the tests have been fixed.

Between filesystem and alphabetical I definitely prefer alphabetical. alphabetical is completely deterministic regardless of OS or culture settings. filesystem is "mostly deterministic" meaning the order shouldn't change on a given OS and culture setting, but it can change across OS/culture. Thus filesystem is the worst of both worlds, tests may pass consistently on one OS/culture but fail on a different one (as we recently saw with ServiceBus tests on Ubuntu 18 with C culture).

So I propose we move from filesystem to alphabetical now as one step forward, then separately consider if we want to try enabling random with its pros and cons.

@mikeharder mikeharder marked this pull request as ready for review May 8, 2020 17:33
@mikeharder
Copy link
Member Author

All pipelines pass with this change, so it should be safe if the team agrees this is a step forward.

@alzimmermsft alzimmermsft self-requested a review May 8, 2020 18:49
@mikeharder mikeharder merged commit 8297bf5 into Azure:master May 8, 2020
@mikeharder mikeharder deleted the run-order-alphabetical branch May 8, 2020 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants