lixmgl commented on code in PR #581:
URL: https://github.com/apache/yunikorn-core/pull/581#discussion_r1266227844
##########
pkg/scheduler/objects/application_test.go:
##########
@@ -385,20 +378,17 @@ func TestAddAllocAsk(t *testing.T) {
// test add alloc ask event
err = common.WaitFor(10*time.Millisecond, time.Second, func() bool {
fmt.Printf("checking event length: %d\n",
eventSystem.Store.CountStoredEvents())
- return eventSystem.Store.CountStoredEvents() == 1
+ return eventSystem.Store.CountStoredEvents() == 3
})
assert.NilError(t, err, "the events should have been processed")
records := eventSystem.Store.CollectEvents()
if records == nil {
t.Fatal("collecting eventChannel should return something")
}
- assert.Equal(t, 1, len(records), "expecting add alloc ask event")
- record := records[0]
- assert.Equal(t, si.EventRecord_APP, record.Type, "incorrect event type,
expect app")
- assert.Equal(t, appID1, record.ObjectID, "incorrect object ID, expected
application ID")
- assert.Equal(t, aKey, record.ReferenceID, "incorrect reference ID,
expected placeholder alloc ID")
- assert.Equal(t, si.EventRecord_ADD, record.EventChangeType, "incorrect
change type, expected add")
- assert.Equal(t, si.EventRecord_APP_REQUEST, record.EventChangeDetail,
"incorrect change detail, expected app request")
+ assert.Equal(t, 3, len(records), "expecting 3 events")
+ isNewApplicationEvent(t, app, records[0])
+ isStateChangeEvent(t, app, si.EventRecord_APP_ACCEPTED, records[1])
+ isNewAllocAskEvent(t, ask, records[2])
Review Comment:
Done.
--
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]