chia7712 commented on code in PR #844:
URL: https://github.com/apache/yunikorn-core/pull/844#discussion_r1568322108
##########
pkg/events/event_store_test.go:
##########
@@ -55,6 +56,16 @@ func TestStoreAndRetrieve(t *testing.T) {
assert.DeepEqual(t, records[0], event1,
cmpopts.IgnoreUnexported(si.EventRecord{}))
assert.DeepEqual(t, records[1], event2,
cmpopts.IgnoreUnexported(si.EventRecord{}))
+ // ensure that the underlying array of the return slice of
CollectEvents() isn't the same as the one in EventStore.events
Review Comment:
Maybe we can add more records after calling `CollectEvents`, and then we do
following checks
1. the two slices have different points
2. the elements of first slice from `CollectEvents` are not changed after
we put more records.
with those checks we don't need to expose a internal method
##########
pkg/events/event_store.go:
##########
@@ -80,6 +81,14 @@ func (es *EventStore) CollectEvents() []*si.EventRecord {
return messages
}
+// test only
+func (es *EventStore) CollectInternalEvents(idx uint64) []*si.EventRecord {
Review Comment:
As it is used by testing only, we should use lowercase letter to expose it
to same package only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]