[Bug] RaftEngineReadIndexTest fails now and then with UnfinishedStubbingException: the alive-peers refresher can call the mocked raft node while a test stubs it
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Read RaftEngineReadIndexTest.java around answerShutdown and testStoppedReadServiceClosureThatRunsFirstFailsAsNotLeader, then inspect RaftEngine.startAlivePeersRefresher and its listAlivePeers call. Reproduce with the stated Maven command and determine whether the refresher can call the mock during stubbing. The linked pull request #3385 is already open; check its status and whether it resolves the intermittent failure.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug Type (问题类型)
others (please edit later)
Before submit
- I have confirmed and searched that there are no similar problems in the historical issue and documents
Environment (环境信息)
- Server Version: PD tests,
hg-pd-testpd-core-testprofile (PDCoreSuiteTest). Seen on the branch of #3376 at171760d25, which does not changeRaftEngineReadIndexTestor the alive-peers refresher ofRaftEngine; both are as onmaster86c05ef9c(the test from #3368, the refresher from #3185) - Backend: none (unit suite)
- OS: Linux, 8 cores, JDK 17
- Data Size: N/A
Expected & Actual behavior (期望与实际表现)
RaftEngineReadIndexTest.testStoppedReadServiceClosureThatRunsFirstFailsAsNotLeader should pass every run. It failed once in three runs of the same commit on 2026-10-20, with Mockito's unfinished-stubbing error while the test stubs readIndex:
[ERROR] org.apache.hugegraph.pd.raft.RaftEngineReadIndexTest.testStoppedReadServiceClosureThatRunsFirstFailsAsNotLeader -- Time elapsed: 0.012 s <<< ERROR!
org.mockito.exceptions.misusing.UnfinishedStubbingException:
Unfinished stubbing detected here:
-> at org.apache.hugegraph.pd.raft.RaftEngineReadIndexTest.answerShutdown(RaftEngineReadIndexTest.java:377)
at org.apache.hugegraph.pd.raft.RaftEngineReadIndexTest.answerShutdown(RaftEngineReadIndexTest.java:382)
at org.apache.hugegraph.pd.raft.RaftEngineReadIndexTest.testStoppedReadServiceClosureThatRunsFirstFailsAsNotLeader(RaftEngineReadIndexTest.java:367)
The runs, all mvn -B -ntp test -pl hugegraph-pd/hg-pd-test -am -P pd-core-test on 171760d25:
| Host | pd-core (run/failures/errors/skipped) |
|---|---|
| 8 cores, JDK 17 | 227/0/1/2 (this error) |
| same host, again | 227/0/0/2 |
| 12 cores, JDK 17 | 227/0/0/2 |
Likely cause, not proven: the test swaps a Mockito mock into the RaftEngine singleton (Whitebox.setInternalState(..., "raftNode", mockNode)) and stubs it, while the engine's pd-raft-alive-peers refresher thread (startAlivePeersRefresher, every ALIVE_PEERS_REFRESH_MS) calls node.listAlivePeers() on whatever node the singleton holds whenever its state machine reports leader. An earlier suite test can leave the singleton started and leading. A call on the mock from that thread while doAnswer(...).when(mockNode).readIndex(...) is in progress is the case Mockito reports as unfinished stubbing.
A fix could stop the refresher for these tests (or give the refresher a node snapshot taken under the same lock the tests use), or stub listAlivePeers on the mock before it is installed.
Vertex/Edge example (问题点 / 边数据举例)
N/A
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
N/A
- Lenguaje dominante
- Java
- Estrellas
- 3.2k
- Forks
- 640
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 90
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/hugegraph
-
[Bug] PD task REST: balanceLeaders throws a bare HTTP 500 during the balance-shard window, and task responses cannot be told apart from a no-op or a follower answerPosiblemente ocupada @pallavithegod la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
apache/hugegraph#3231 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
[Bug] PD raft port accepts jraft CLI membership requests, which bypass the checks of changePeerList and updatePdRaftPosiblemente ocupada @Mihir-Rabari la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
[Bug] PD TTL cleanup deletes the marker-shaped name instead of the expired key, so expired values stay in the store until readPosiblemente ocupada @bitflicker64 la tomó hace 1 día. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
[Task] Establish systematic performance baselines and optimization trackingPosiblemente ocupada @contrueCT la tomó hace 5 días. Abiertohelp wanted improvement rust
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
apache/hugegraph#3346 · 2 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/hugegraph
Issues similares
-
Optimize consumer version heatmap aggregation to avoid repeated scansPosiblemente ocupada @praykaria31 la tomó hoy. Abiertotype/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Apicurio/apicurio-registry#10662 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
a:false-positive
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
status: waiting-for-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
spring-projects/spring-boot#52347 ·
Los mantenedores suelen responder en 2 días
-
bug untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
opensearch-project/opensearch-migrations#3480 ·
Los mantenedores suelen responder en 2 días
-
[Bug] Certificate expiry sorting can reverse UTC order across a viewer daylight-saving gapPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/rocketmq-dashboard#7318 ·
Los mantenedores suelen responder en 3 días