chia7712 commented on code in PR #912:
URL: https://github.com/apache/yunikorn-core/pull/912#discussion_r1670489479
##########
pkg/events/event_system_test.go:
##########
@@ -49,7 +50,11 @@ func TestSimpleStartAndStop(t *testing.T) {
// should be retrieved from the EventStore
func TestSingleEventStoredCorrectly(t *testing.T) {
Init()
- eventSystem := GetEventSystem().(*EventSystemImpl) //nolint:errcheck
+ eventSystem, ok := GetEventSystem().(*EventSystemImpl)
+ if !ok {
Review Comment:
this is in testing, so we should throw exception, right?
##########
pkg/events/event_system_test.go:
##########
@@ -82,7 +87,11 @@ func TestSingleEventStoredCorrectly(t *testing.T) {
func TestGetEvents(t *testing.T) {
Init()
- eventSystem := GetEventSystem().(*EventSystemImpl) //nolint:errcheck
+ eventSystem, ok := GetEventSystem().(*EventSystemImpl)
Review Comment:
ditto
##########
pkg/log/logger_test.go:
##########
@@ -243,7 +243,9 @@ func TestParentLogger(t *testing.T) {
func resetTestLogger() {
// flush log
- logger.Sync() //nolint:errcheck
+ if err := logger.Sync(); err != nil {
Review Comment:
ditto
##########
pkg/scheduler/objects/application_state.go:
##########
@@ -129,97 +129,149 @@ func eventDesc() fsm.Events {
Src: []string{Completed.String(), Failed.String(),
Rejected.String()},
Dst: Expired.String(),
},
- }
-}
+ fsm.Callbacks{
+ // The state machine is tightly tied to the Application
object.
Review Comment:
please revert unrelated changes ...
##########
pkg/events/event_system_test.go:
##########
@@ -114,7 +123,11 @@ func TestConfigUpdate(t *testing.T) {
defer configs.SetConfigMap(map[string]string{})
Init()
- eventSystem := GetEventSystem().(*EventSystemImpl) //nolint:errcheck
+ eventSystem, ok := GetEventSystem().(*EventSystemImpl)
Review Comment:
ditto
--
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]