Skip to content

Commit 96c3460

Browse files
committed
Fix test stability
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
1 parent 5ac1176 commit 96c3460

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

bundles/org.openhab.binding.http/src/test/java/org/openhab/binding/http/RateLimitedHttpClientTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ private void doLimitTest(int setDelay, List<Boolean> config) {
120120

121121
requestFuture.thenAccept(request -> {
122122
try {
123-
responses.add(new Response(nextSeqNumber, request.send()));
123+
long requestTime = System.currentTimeMillis();
124+
responses.add(new Response(nextSeqNumber, requestTime, request.send()));
124125
} catch (Exception e) {
125126
}
126127
});
@@ -133,11 +134,12 @@ private void doLimitTest(int setDelay, List<Boolean> config) {
133134

134135
private static class Response {
135136
public final int seqNumber;
136-
public final long time = System.currentTimeMillis();
137+
public final long time;
137138
public final String content;
138139

139-
public Response(int seqNumber, ContentResponse contentResponse) {
140+
public Response(int seqNumber, long time, ContentResponse contentResponse) {
140141
this.seqNumber = seqNumber;
142+
this.time = time;
141143
this.content = contentResponse.getContentAsString();
142144
}
143145
}

0 commit comments

Comments
 (0)