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

docs: Investigation incorrect outcome for flaky tests #1181

Merged
merged 1 commit into from
Oct 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion docs/bugs/914_falsy_positive_outcome_for_flaky_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
|Date|Who?|Action|
|---|---|---|
|31th July 2020|[pawelpasterz](https://github.com/pawelpasterz)|created|
|1st October 2020|[adamfilipow92](https://github.com/adamfilipow92)|update|
| | | |

### Description
Expand Down Expand Up @@ -71,4 +72,36 @@ The following must occur:
} ?: outcome
}
```
2. Add unit tests to cover this case.
2. The test below reflects potential but rare behavior.

```kotlin
@Test
fun `savedMatrix should have flaky outcome when at least one test is flaky`() {
val expectedOutcome = "flaky"
val successStepExecution = createStepExecution(1) // success
// https://github.com/Flank/flank/issues/918
// This test covers edge case where summary for both step and execution is null and outcome of
// saved matrix was not changed and is set to success
val malformed = createStepExecution(stepId = -666, executionId = -666) // flaky

// below order in the list matters!
val executions = listOf(
successStepExecution,
successStepExecution,
malformed
)

val testMatrix = testMatrix().apply {
testMatrixId = "123"
state = FINISHED
resultStorage = createResultsStorage()
testExecutions = executions
}

val savedMatrix = createSavedMatrix(testMatrix)

assertEquals(expectedOutcome, savedMatrix.outcome)
}
```

3. This issue is not deterministic and really difficult to reproduce by manual tests. The community not reporting this issue for some time.