Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-2666

Fix DeepEqual comparison in Test_fixedRule_ruleDAO

    XMLWordPrintableJSON

Details

    Description

      The test case Test_fixedRule_ruleDAO/filter can randomly fail due to the non-deterministic nature of map key iteration:

      fixed_rule_test.go:285: assertion failed: 
                  --- tt.want
                  +++ ruleDAO
                    &dao.RuleDAO{
                    	Name:       "fixed",
                    	Parameters: {"create": "true", "qualified": "false", "queue": "default"},
                    	Filter: &dao.FilterDAO{
                    		Type:     "allow",
                    		UserList: nil,
                    		GroupList: []string{
                  - 			"group1",
                  + 			"group2",
                  - 			"group2",
                  + 			"group1",
                    		},
                    		UserExp:  "",
                    		GroupExp: "",
                    	},
                    	ParentRule: nil,
                    }
      

      We use maps.Keys() when we create the user list and group list in FilterDAO.

      Attachments

        Issue Links

          Activity

            People

              pbacsko Peter Bacsko
              pbacsko Peter Bacsko
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: