Commit baf8b76
Reduce flakyness of testExemplarsClassicHistogram (#1842)
I've been encountering issues with
`io.prometheus.metrics.core.metrics.HistogramTest.testExemplarsClassicHistogram`
when running tests locally, lot's of these:
```
[ERROR] Tests run: 28, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.279 s <<< FAILURE! -- in io.prometheus.metrics.core.metrics.HistogramTest
[ERROR] io.prometheus.metrics.core.metrics.HistogramTest.testExemplarsClassicHistogram -- Time elapsed: 0.055 s <<< ERROR!
java.lang.NullPointerException: Cannot invoke "io.prometheus.metrics.model.snapshots.Exemplar.getValue()" because "actual" is null
at io.prometheus.metrics.core.metrics.TestUtil.assertExemplarEquals(TestUtil.java:13)
at io.prometheus.metrics.core.metrics.HistogramTest.testExemplarsClassicHistogram(HistogramTest.java:1054)
```
attempting to make it a little more reliable with awaitility.
Alternatively we could refactor the ExemplarSampler to take a clock as
an argument so we could mock it, but I figured we could start here
before we change the production code
---------
Signed-off-by: Jay DeLuca <jaydeluca4@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent ba308cf commit baf8b76
File tree
1 file changed
+44
-5
lines changed- prometheus-metrics-core/src/test/java/io/prometheus/metrics/core/metrics
1 file changed
+44
-5
lines changedLines changed: 44 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
1020 | 1022 | | |
1021 | 1023 | | |
1022 | 1024 | | |
1023 | | - | |
| 1025 | + | |
1024 | 1026 | | |
1025 | 1027 | | |
1026 | 1028 | | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1027 | 1037 | | |
1028 | 1038 | | |
1029 | 1039 | | |
| |||
1036 | 1046 | | |
1037 | 1047 | | |
1038 | 1048 | | |
1039 | | - | |
| 1049 | + | |
1040 | 1050 | | |
1041 | 1051 | | |
1042 | | - | |
| 1052 | + | |
1043 | 1053 | | |
1044 | 1054 | | |
1045 | | - | |
| 1055 | + | |
1046 | 1056 | | |
1047 | 1057 | | |
1048 | 1058 | | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
1049 | 1071 | | |
1050 | 1072 | | |
1051 | 1073 | | |
| |||
1072 | 1094 | | |
1073 | 1095 | | |
1074 | 1096 | | |
1075 | | - | |
| 1097 | + | |
1076 | 1098 | | |
1077 | 1099 | | |
1078 | 1100 | | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
1079 | 1108 | | |
1080 | 1109 | | |
1081 | 1110 | | |
1082 | 1111 | | |
1083 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
1084 | 1123 | | |
1085 | 1124 | | |
1086 | 1125 | | |
| |||
0 commit comments