[chore] fix var naming (#9579)

Part of #9577

Signed-off-by: Alex Boten <aboten@lightstep.com>
This commit is contained in:
Alex Boten 2024-02-13 11:04:59 -08:00 committed by GitHub
parent 4688461318
commit 44356bd218
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 12 deletions

View File

@ -129,7 +129,7 @@ func checkConsumeContractScenario(params CheckConsumeContractParams, decisionFun
// Begin generating data to the receiver.
var generatedIds idSet
var generatedIDs idSet
var generatedIndex int64
var mux sync.Mutex
var wg sync.WaitGroup
@ -151,7 +151,7 @@ func checkConsumeContractScenario(params CheckConsumeContractParams, decisionFun
require.Greater(params.T, len(ids), 0)
mux.Lock()
duplicates := generatedIds.mergeSlice(ids)
duplicates := generatedIDs.mergeSlice(ids)
mux.Unlock()
// Check that the generator works correctly. There may not be any duplicates in the
@ -172,7 +172,7 @@ func checkConsumeContractScenario(params CheckConsumeContractParams, decisionFun
assert.Failf(params.T, "found duplicate elements in received and dropped data", "keys=%v", duplicates)
}
// Compare accepted+dropped with generated. Once they are equal it means all data is seen by the consumer.
missingInOther, onlyInOther := generatedIds.compare(acceptedAndDropped)
missingInOther, onlyInOther := generatedIDs.compare(acceptedAndDropped)
return len(missingInOther) == 0 && len(onlyInOther) == 0
}, 5*time.Second, 10*time.Millisecond)
@ -184,7 +184,7 @@ func checkConsumeContractScenario(params CheckConsumeContractParams, decisionFun
// Make sure generated and accepted+dropped are exactly the same.
missingInOther, onlyInOther := generatedIds.compare(acceptedAndDropped)
missingInOther, onlyInOther := generatedIDs.compare(acceptedAndDropped)
if len(missingInOther) != 0 {
assert.Failf(params.T, "found elements sent that were not delivered", "keys=%v", missingInOther)
}
@ -198,9 +198,9 @@ func checkConsumeContractScenario(params CheckConsumeContractParams, decisionFun
// Print some stats to help debug test failures.
fmt.Printf(
"Sent %d, accepted=%d, expected dropped=%d, non-permanent errors retried=%d\n",
len(generatedIds),
len(consumer.acceptedIds),
len(consumer.droppedIds),
len(generatedIDs),
len(consumer.acceptedIDs),
len(consumer.droppedIDs),
consumer.nonPermanentFailures,
)
}
@ -321,8 +321,8 @@ type mockConsumer struct {
t *testing.T
consumeDecisionFunc consumeDecisionFunc
mux sync.Mutex
acceptedIds idSet
droppedIds idSet
acceptedIDs idSet
droppedIDs idSet
nonPermanentFailures int
}
@ -404,7 +404,7 @@ func (m *mockConsumer) consume(ids idSet) error {
if consumererror.IsPermanent(err) {
// It is a permanent error, which means we need to drop the data.
// Remember the ids of dropped elements.
duplicates := m.droppedIds.merge(ids)
duplicates := m.droppedIDs.merge(ids)
require.Empty(m.t, duplicates, "elements that were dropped previously were sent again")
} else {
// It is a non-permanent error. Don't add it to the drop list. Remember the number of
@ -416,7 +416,7 @@ func (m *mockConsumer) consume(ids idSet) error {
}
// The decision is a success. Remember the ids of the data in the accepted list.
duplicates := m.acceptedIds.merge(ids)
duplicates := m.acceptedIDs.merge(ids)
require.Empty(m.t, duplicates, "elements that were accepted previously were sent again")
return nil
}
@ -426,7 +426,7 @@ func (m *mockConsumer) consume(ids idSet) error {
func (m *mockConsumer) acceptedAndDropped() (acceptedAndDropped idSet, duplicates []UniqueIDAttrVal) {
m.mux.Lock()
defer m.mux.Unlock()
return m.acceptedIds.union(m.droppedIds)
return m.acceptedIDs.union(m.droppedIDs)
}
func CreateOneLogWithID(id UniqueIDAttrVal) plog.Logs {