Skip to content

fix(controller): Fix getPodByNode, TestGetPodByNode. Fixes #6458#6897

Merged
alexec merged 4 commits intoargoproj:masterfrom
micahbeeman-wf:fix_TestGetPodByNode
Oct 15, 2021
Merged

fix(controller): Fix getPodByNode, TestGetPodByNode. Fixes #6458#6897
alexec merged 4 commits intoargoproj:masterfrom
micahbeeman-wf:fix_TestGetPodByNode

Conversation

@micahbeeman-wf
Copy link
Contributor

@micahbeeman-wf micahbeeman-wf commented Oct 8, 2021

Signed-off-by: Micah Beeman micah.beeman@workiva.com

getPodByNode was broken by the changes in #6712
Fixed by using the PodName util to obtain the pod name to pass to getPod
Added sleep after pods are created to fix flakiness in TestGetPodByNode

Fixes #6458

@micahbeeman-wf
Copy link
Contributor Author

@alexec Can you approve me for running workflows so I can fix this test?

@micahbeeman-wf
Copy link
Contributor Author

--- FAIL: TestGetPodByNode (0.10s)
    operator_test.go:3553: 
        	Error Trace:	operator_test.go:3553
        	Error:      	Expected value not to be nil.
        	Test:       	TestGetPodByNode

@micahbeeman-wf
Copy link
Contributor Author

Went back to the commit which added this test (cc701a1) and it passes consistently there. This test now fails consistently so something has regressed since this went in.

@micahbeeman-wf
Copy link
Contributor Author

The test fails because it expects the cache to contain a pod called argo/dag-events-1004301846 but the cache actually contains argo/dag-events-whalesay-1004301846.

@micahbeeman-wf
Copy link
Contributor Author

@alexec do you know of a recent change that would cause the template name (whalesay) to be included in the pod name?

@alexec
Copy link
Contributor

alexec commented Oct 12, 2021

@alexec do you know of a recent change that would cause the template name (whalesay) to be included in the pod name?

Yes. That changed recently. Test will need to be updated.

@micahbeeman-wf
Copy link
Contributor Author

@alexec do you know of a recent change that would cause the template name (whalesay) to be included in the pod name?

Yes. That changed recently. Test will need to be updated.

What was the change?

@alexec
Copy link
Contributor

alexec commented Oct 12, 2021

Um. See Git history?

@micahbeeman-wf
Copy link
Contributor Author

Looks like it was changed in #6712

@micahbeeman-wf micahbeeman-wf changed the title Unskip TestGetPodByNode to test its flakiness Update TestGetPodByNode, fixes #6458 Oct 14, 2021
@micahbeeman-wf
Copy link
Contributor Author

Now that the test is running successfully it appears that it is flaky, failing about 3% of the time.

@micahbeeman-wf micahbeeman-wf changed the title Update TestGetPodByNode, fixes #6458 fix(controller): Update TestGetPodByNode, fixes #6458 Oct 14, 2021
@micahbeeman-wf micahbeeman-wf changed the title fix(controller): Update TestGetPodByNode, fixes #6458 fix(controller): Update TestGetPodByNode. Fixes #6458 Oct 14, 2021
Signed-off-by: Micah Beeman <micah.beeman@workiva.com>
Signed-off-by: Micah Beeman <micah.beeman@workiva.com>
Signed-off-by: Micah Beeman <micah.beeman@workiva.com>
@micahbeeman-wf
Copy link
Contributor Author

@alexec Do you have to approve each run of the tests?

Signed-off-by: Micah Beeman <micah.beeman@workiva.com>
@micahbeeman-wf micahbeeman-wf changed the title fix(controller): Update TestGetPodByNode. Fixes #6458 fix(controller): Fix getPodByNode, TestGetPodByNode. Fixes #6458 Oct 14, 2021
@micahbeeman-wf micahbeeman-wf marked this pull request as ready for review October 14, 2021 20:02
@micahbeeman-wf
Copy link
Contributor Author

@alexec I updated getPodByNode to support the changes made in #6712 and fixed the test flakiness, so this is ready to review. Can you allow my workflow to run?

Copy link
Contributor

@kennytrytek kennytrytek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, assuming the tests pass. ⛄

@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #6897 (08c30e7) into master (c5b1533) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6897      +/-   ##
==========================================
+ Coverage   48.44%   48.49%   +0.05%     
==========================================
  Files         265      265              
  Lines       19259    19260       +1     
==========================================
+ Hits         9330     9341      +11     
+ Misses       8880     8871       -9     
+ Partials     1049     1048       -1     
Impacted Files Coverage Δ
workflow/controller/operator.go 71.22% <100.00%> (+0.10%) ⬆️
workflow/controller/controller.go 22.59% <0.00%> (+0.28%) ⬆️
workflow/controller/workflowpod.go 74.41% <0.00%> (+0.51%) ⬆️
cmd/argoexec/commands/emissary.go 51.79% <0.00%> (+1.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5b1533...08c30e7. Read the comment docs.

@micahbeeman-wf
Copy link
Contributor Author

@alexec I am not sure why the E2E test failed, seems unrelated to my changes?

@alexec
Copy link
Contributor

alexec commented Oct 15, 2021

That test is flakey.

return nil, fmt.Errorf("Expected node type %s, got %s", wfv1.NodeTypePod, node.Type)
}
return woc.controller.getPod(woc.wf.GetNamespace(), node.ID)
podName := wfutil.PodName(woc.wf.Name, node.Name, node.TemplateName, node.ID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a bug fix, needs to be back-ported to v3.2

@alexec alexec merged commit 41515d6 into argoproj:master Oct 15, 2021
This was referenced Oct 15, 2021
sarabala1979 pushed a commit that referenced this pull request Oct 19, 2021
Signed-off-by: Micah Beeman <micah.beeman@workiva.com>
kriti-sc pushed a commit to kriti-sc/argo-workflows that referenced this pull request Oct 24, 2021
 (argoproj#6897)

Signed-off-by: Micah Beeman <micah.beeman@workiva.com>
Signed-off-by: kriti-sc <kathuriakriti1@gmail.com>
@alexec alexec mentioned this pull request Nov 5, 2021
25 tasks
@sarabala1979 sarabala1979 mentioned this pull request Dec 15, 2021
73 tasks
@sarabala1979 sarabala1979 mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestGetPodByNode is flakey

4 participants