Skip to content

Commit

Permalink
use || when setting flakiness so that plugins don't unset flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
wuillaum authored and rexhoffman committed Jun 21, 2021
1 parent 7142219 commit f67cf1b
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ public class TestResult implements Serializable, Nameable, Parameterizable, Stat
protected boolean retry;
protected final Map<String, Object> extra = new HashMap<>();


public TestResult resetFlaky() {
this.flaky = false;
return this;
}

/**
* Sets the TestResult's flaky status
*
* Performs logical OR on existing flakiness so that other plugins that
* have previously set flakiness don't get their value overwritten 'falsely'
*
* Trying to deliberatey set flakiness to false? use {@link #resetFlaky()}
*
* @param flakeStatus Flaky status
*/
public TestResult setFlaky(final boolean flakeStatus) {
this.flaky = flakeStatus || this.flaky;
return this;
}

@JsonProperty
public String getSource() {
return getUid() + ".json";
Expand Down

0 comments on commit f67cf1b

Please sign in to comment.