Merge branch 'stable-3.2' into stable-3.3
* stable-3.2:
Do not use timer.getStartTime() when propating timers metrics
Change-Id: I7abf8f2f353d889baf9e0f5f97c2867b7fd1d3ae
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueue.java b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueue.java
index f3e38fd..380ac8e 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueue.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueue.java
@@ -424,7 +424,7 @@
FetchApiClient fetchClient = fetchClientFactory.create(source);
repLog.info("Pull replication REST API fetch to {} for {}:{}", apiUrl, project, refName);
Context<String> timer = fetchMetrics.startEnd2End(source.getRemoteConfigName());
- HttpResult result = fetchClient.callFetch(project, refName, uri, timer.getStartTime());
+ HttpResult result = fetchClient.callFetch(project, refName, uri);
long elapsedMs = TimeUnit.NANOSECONDS.toMillis(timer.stop());
boolean resultSuccessful = result.isSuccessful();
repLog.info(
diff --git a/src/test/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueueTest.java b/src/test/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueueTest.java
index 48e0e71..6d4c499 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueueTest.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/replication/pull/ReplicationQueueTest.java
@@ -19,7 +19,6 @@
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyInt;
-import static org.mockito.Mockito.anyLong;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.lenient;
@@ -138,8 +137,7 @@
lenient()
.when(fetchRestApiClient.callSendObjects(any(), anyString(), any(), any()))
.thenReturn(httpResult);
- when(fetchRestApiClient.callFetch(any(), anyString(), any(), anyLong()))
- .thenReturn(fetchHttpResult);
+ when(fetchRestApiClient.callFetch(any(), anyString(), any())).thenReturn(fetchHttpResult);
when(fetchRestApiClient.initProject(any(), any())).thenReturn(successfulHttpResult);
when(successfulHttpResult.isSuccessful()).thenReturn(true);
when(httpResult.isSuccessful()).thenReturn(true);
@@ -216,7 +214,7 @@
objectUnderTest.onGitReferenceUpdated(event);
- verify(fetchRestApiClient).callFetch(any(), anyString(), any(), anyLong());
+ verify(fetchRestApiClient).callFetch(any(), anyString(), any());
}
@Test
@@ -229,7 +227,7 @@
objectUnderTest.onGitReferenceUpdated(event);
- verify(fetchRestApiClient).callFetch(any(), anyString(), any(), anyLong());
+ verify(fetchRestApiClient).callFetch(any(), anyString(), any());
}
@Test
@@ -245,7 +243,7 @@
objectUnderTest.onGitReferenceUpdated(event);
- verify(fetchRestApiClient).callFetch(any(), anyString(), any(), anyLong());
+ verify(fetchRestApiClient).callFetch(any(), anyString(), any());
}
@Test