Change:
<!-- Please only use this template for submitting reports about flaky tests or jobs (pass or fail with no underlying change in code) in Kubernetes CI --Which jobs are flaking: integration-master Which test(s) are flaking: TestPostFilterPlugin Testgrid link: Reason for failure: Anything else we need to know: links to appreciated links to specific failures in spyglass appreciated <!-- Please see the deflaking doc () for more guidance! --/sig testing
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/sig scheduling /remove-sig testing
/assign

Discussion:
} type FilterPlugin struct { <del> numFilterCalled int </del> <ins> numFilterCalled int32 </ins> failFilter      bool rejectFilter    bool }

// Filter is a test function that returns an error or nil, depending on the // value of "failFilter". func (fp *FilterPlugin) Filter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status { <del> fp.numFilterCalled++ </del> <ins> atomic.AddInt32(&fp.numFilterCalled, 1) </ins> if fp.failFilter { return framework.NewStatus(framework.Error, fmt.Sprintf("injecting failure for pod %v", pod.Name))

// TestPostFilterPlugin tests invocation of postfilter plugins. func TestPostFilterPlugin(t *testing.T) { <del> numNodes := 1 </del> <ins> var numNodes int32 = 1 </ins> tests := []struct { name                      string <del> numNodes                  int </del> <ins> numNodes                  int32 </ins> rejectFilter              bool failScore                 bool rejectPostFilter          bool <del> expectFilterNumCalled     int </del> <ins> expectFilterNumCalled     int32 </ins> expectScoreNumCalled      int32 expectPostFilterNumCalled int }{ { name:                      "Filter passed and Score success", <del> numNodes:                  3, </del> <ins> numNodes:                  30, </ins> rejectFilter:              false, failScore:                 false, rejectPostFilter:          false, <del> expectFilterNumCalled:     3, expectScoreNumCalled:      3, </del> <ins> expectFilterNumCalled:     30, expectScoreNumCalled:      30, </ins> expectPostFilterNumCalled: 0, }, {

testCtx := initTestSchedulerForFrameworkTest( t, testutils.InitTestMaster(t, fmt.Sprintf("postfilter%v-", i), nil), <del> tt.numNodes, </del> <ins> int(tt.numNodes), </ins> scheduler.WithProfiles(prof), scheduler.WithFrameworkOutOfTreeRegistry(registry), )

t.Errorf("Didn't expect the pod to be scheduled.") } <del> if filterPlugin.numFilterCalled < tt.expectFilterNumCalled { t.Errorf("Expected the filter plugin to be called at least %v times, but got %v.", tt.expectFilterNumCalled, filterPlugin.numFilterCalled) </del> <ins> if numFilterCalled := atomic.LoadInt32(&filterPlugin.numFilterCalled); numFilterCalled < tt.expectFilterNumCalled { t.Errorf("Expected the filter plugin to be called at least %v times, but got %v.", tt.expectFilterNumCalled, numFilterCalled) </ins> } if numScoreCalled := atomic.LoadInt32(&scorePlugin.numScoreCalled); numScoreCalled < tt.expectScoreNumCalled { t.Errorf("Expected the score plugin to be called at least %v times, but got %v.", tt.expectScoreNumCalled, numScoreCalled)

if err = testutils.WaitForPodToSchedule(testCtx.ClientSet, pod); err != nil { t.Errorf("Expected the pod to be scheduled. error: %v", err) } <del> if filterPlugin.numFilterCalled != tt.expectFilterNumCalled { t.Errorf("Expected the filter plugin to be called %v times, but got %v.", tt.expectFilterNumCalled, filterPlugin.numFilterCalled) </del> <ins> if numFilterCalled := atomic.LoadInt32(&filterPlugin.numFilterCalled); numFilterCalled != tt.expectFilterNumCalled { t.Errorf("Expected the filter plugin to be called %v times, but got %v.", tt.expectFilterNumCalled, numFilterCalled) </ins> } if numScoreCalled := atomic.LoadInt32(&scorePlugin.numScoreCalled); numScoreCalled != tt.expectScoreNumCalled { t.Errorf("Expected the score plugin to be called %v times, but got %v.", tt.expectScoreNumCalled, numScoreCalled)