[flake test] reconfig application organization
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 73/100
Direzione di ricerca
Start with integration/test/reconfig_app_org_test.go and integration/test/block_query_client.go; read the two checks after PullFromAssemblers and how PullBlocks reads blockchain height. Confirm whether TotalBlocks includes the genesis block, then add a height wait before both checks and handle PullBlocks errors on the test goroutine. Run TestReconfigAppOrg and verify it waits for the committer while still detecting missing transactions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
TestReconfigAppOrg fails intermittently. It checks the committer's blocks right after the orderer delivers them, without waiting for the committer to commit them.
Failing runs
All three fail the same way:
utils.go:848: Finished pull and count: blocks 2, txs 11 from party: 1
reconfig_app_org_test.go:95: Blockchain height: 1
expected: 11
actual : 1
Messages: number of envelopes does not match number of transactions sent
--- FAIL: TestReconfigAppOrg (26.90s)
Cause
- The test waits until the assemblers deliver all the blocks (reconfig_app_org_test.go#L95), then calls
requireCommitterEnvelopesright away (#L96). PullBlocksreads the committer's height once and fetches only that many blocks (block_query_client.go#L47-L56).- If the committer hasn't committed block 1 yet, its height is 1. The test then gets only the genesis block, with its one envelope, and fails. Re-runs pass, so the committer does commit the block; the test reads its height too early.
verifyPostReconfigBlockshas the same race after the reconfig (#L336).
Proposed fix
Wait until the committer reaches the orderer's height before checking its blocks:
testutils.PullFromAssemblersreturns each party'sBlockPullerInfo, whoseTotalBlocksis the number of blocks the orderer delivered.- Add
BlockQueryClient.WaitForHeight, which pollsGetBlockchainInfountil the committer's height reaches that number. - Call it before
requireCommitterEnvelopesand beforeverifyPostReconfigBlocks. For the second,submitPeerOrgReconfigreturns the block count of its ownPullFromAssemblerscall (#L318).
// WaitForHeight waits until the committer's height reaches height.
func (c *BlockQueryClient) WaitForHeight(t *testing.T, ctx context.Context, height uint64) {
t.Helper()
client, conn := c.createClient(t)
defer conn.Close()
require.EventuallyWithT(t, func(ct *assert.CollectT) {
info, err := (*client).GetBlockchainInfo(ctx, &emptypb.Empty{})
require.NoError(ct, err)
require.GreaterOrEqual(ct, info.GetHeight(), height)
}, time.Minute, 100*time.Millisecond)
}
info := testutils.PullFromAssemblers(t, pullOpts(totalTxNumber, nil))
blockQueryClient.WaitForHeight(t, ctx, uint64(info[parties[0]].TotalBlocks))
requireCommitterEnvelopes(t, blockQueryClient, totalTxNumber)
The assertions stay exact: if the committer loses a transaction, the test still fails, after the wait.
To confirm while fixing: that TotalBlocks counts the genesis block, as the committer's height does. The failing log suggests it does: the assemblers report 2 blocks, and the committer was at height 1 with only block 0.
Also
PullBlocks calls require.NoError(t, …) inside its goroutine (block_query_client.go#L58). t.FailNow must run on the test's goroutine, so a failed fetch there doesn't stop the test properly. The goroutine should return the error to the caller instead.
- Lingua principale
- Go
- Stelle
- 65
- Fork
- 85
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hyperledger/fabric-x
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
hyperledger/fabric-x#316 ·
-
Tools: admin cli json manipulation automationForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
hyperledger/fabric-x#299 ·
-
bug(fxconfig): SubmitTransaction and SubmitTransactionWithWait close the orderer client after every call via sync.Once-cached providerForse già presa @ARYANPATEL-BIT l’ha presa 209 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hyperledger/fabric-x#252 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
hyperledger/fabric-x#243 ·
-
bug(fxconfig/transaction): Endorse() silently appends duplicate endorsements when called twice with the same signerForse già presa @Prachi194agrawal l’ha presa 209 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hyperledger/fabric-x#241 · 1 commento ·
Tutte le issue di hyperledger/fabric-x
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
prime-radiant-inc/evener#8066 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 60/100
slavakurilyak/awesome-ai-agents#1100 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
hyperledger/SmartBFT#803 ·
I maintainer di solito rispondono entro 1 giorno
-
Craft Agents: magpie's models are written without supportsThinking, so every model shows thinkingAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100