make+itest: allow the same test to be run in parallel

This commit is contained in:
Oliver Gugger committed 2020-11-10 13:57:31 +01:00
1 parent 72cacb9c5e
commit 47e8882480
3 files changed
+23 -3

No files matched your search

+10 -1
View File
@@ -96,6 +96,15 @@ func getTestCaseSplitTranche() ([]*testCase, uint, uint) {
runTranche = *testCasesRunTranche
}
// There's a special flake-hunt mode where we run the same test multiple
// times in parallel. In that case the tranche index is equal to the
// thread ID, but we need to actually run all tests for the regex
// selection to work.
threadID := runTranche
if numTranches == 1 {
runTranche = 0
}
numCases := uint(len(allTestCases))
testsPerTranche := numCases / numTranches
trancheOffset := runTranche * testsPerTranche
@@ -104,7 +113,7 @@ func getTestCaseSplitTranche() ([]*testCase, uint, uint) {
trancheEnd = numCases
}
return allTestCases[trancheOffset:trancheEnd], runTranche, trancheOffset
return allTestCases[trancheOffset:trancheEnd], threadID, trancheOffset
}
func rpcPointToWirePoint(t *harnessTest, chanPoint *lnrpc.ChannelPoint) wire.OutPoint {