# FlakyTest

# FlakyTest

Artifact:[androidx.test:runner](https://developer.android.com/jetpack/androidx/releases/test)  
[View Source](https://cs.android.com/search?q=file:androidx/test/filters/FlakyTest.java+class:androidx.test.filters.FlakyTest)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/filters/FlakyTest "View this page in Java")

<br />

```
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.METHOD, ElementType.TYPE])
annotation FlakyTest
```

<br />

*** ** * ** ***

Designates a test as being flaky (non-deterministic).

Can then be used to filter tests on execution using -e annotation or -e notAnnotation as desired.

## Summary

|                                      ### Public functions                                       |
|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)          | [bugId](https://developer.android.com/reference/kotlin/androidx/test/filters/FlakyTest#bugId())`()` An optional bug number associated with the test. -1 Means that no bug number is associated with the flaky annotation. |
| `abstract `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [detail](https://developer.android.com/reference/kotlin/androidx/test/filters/FlakyTest#detail())`()` Details, such as the reason of why the test is flaky.                                                               |

## Public functions

### bugId

```
abstract fun bugId(): Int
```

An optional bug number associated with the test. -1 Means that no bug number is associated with the flaky annotation.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|-----|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | int |

### detail

```
abstract fun detail(): String!
```

Details, such as the reason of why the test is flaky.  

|                                       Returns                                        |
|--------------------------------------------------------------------------------------|--------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | String |