Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flaky: yet another non-deterministic tests failure #974

Closed
jkremser opened this issue Oct 18, 2022 · 3 comments · Fixed by #1597
Closed

flaky: yet another non-deterministic tests failure #974

jkremser opened this issue Oct 18, 2022 · 3 comments · Fixed by #1597
Labels
good first issue Good for newcomers

Comments

@jkremser
Copy link
Member

sometimes our unit tests fails on this:

--- FAIL: TestCanGetExternalTargetsFromK8gbInAnotherLocation (0.01s)
    gslb_controller_reconciliation_test.go:525: 
        	Error Trace:	gslb_controller_reconciliation_test.go:525
        	            				fakedns.go:78
        	            				gslb_controller_reconciliation_test.go:503
        	Error:      	Not equal: 
        	            	expected: []*endpoint.Endpoint{(*endpoint.Endpoint)(0xc0002bc1c0), (*endpoint.Endpoint)(0xc0002bc230)}
        	            	actual  : []*endpoint.Endpoint{(*endpoint.Endpoint)(0xc00010d1f0), (*endpoint.Endpoint)(0xc00010d260)}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -17,8 +17,8 @@
        	            	   Targets: (endpoint.Targets) (len=6) {
        	            	+   (string) (len=8) "10.1.0.1",
        	            	+   (string) (len=8) "10.1.0.2",
        	            	+   (string) (len=8) "10.1.0.3",
        	            	    (string) (len=8) "10.0.0.1",
        	            	    (string) (len=8) "10.0.0.2",
        	            	-   (string) (len=8) "10.0.0.3",
        	            	-   (string) (len=8) "10.1.0.1",
        	            	-   (string) (len=8) "10.1.0.2",
        	            	-   (string) (len=8) "10.1.0.3"
        	            	+   (string) (len=8) "10.0.0.3"
        	            	   },
        	Test:       	TestCanGetExternalTargetsFromK8gbInAnotherLocation
        	Messages:   	got:
        	            	 [
        	            		{
        	            			"dnsName": "localtargets-roundrobin.cloud.example.com",
        	            			"targets": [
        	            				"10.0.0.1",
        	            				"10.0.0.2",
        	            				"10.0.0.3"
        	            			],
        	            			"recordType": "A",
        	            			"recordTTL": 30
        	            		},
        	            		{
        	            			"dnsName": "roundrobin.cloud.example.com",
        	            			"targets": [
        	            	actual  : map[string][]string{"roundrobin.cloud.example.com":[]string{"10.0.0.1", "10.0.0.2", "10.0.0.3", "10.1.0.1", "10.1.0.2", "10.1.0.3"}}
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -2,8 +2,8 @@
        	            	  (string) (len=28) "roundrobin.cloud.example.com": ([]string) (len=6) {
        	            	+  (string) (len=8) "10.0.0.1",
        	            	+  (string) (len=8) "10.0.0.2",
        	            	+  (string) (len=8) "10.0.0.3",
        	            	   (string) (len=8) "10.1.0.1",
        	            	   (string) (len=8) "10.1.0.2",
        	            	-  (string) (len=8) "10.1.0.3",
        	            	-  (string) (len=8) "10.0.0.1",
        	            	-  (string) (len=8) "10.0.0.2",
        	            	-  (string) (len=8) "10.0.0.3"
        	            	+  (string) (len=8) "10.1.0.3"
        	            	  }
        	Test:       	TestCanGetExternalTargetsFromK8gbInAnotherLocation
        	Messages:   	got:
        	            	 map[roundrobin.cloud.example.com:[10.1.0.1 10.1.0.2 10.1.0.3 10.0.0.1 10.0.0.2 10.0.0.3]] Gslb Records status,
        	            	
        	            	 want:
        	            	 map[roundrobin.cloud.example.com:[10.0.0.1 10.0.0.2 10.0.0.3 10.1.0.1 10.1.0.2 10.1.0.3]]
FakeDNS listening on port 7753 

https://github.com/k8gb-io/k8gb/actions/runs/3273083165/jobs/5384868955#step:7:819

@jkremser
Copy link
Member Author

hmm:

        	Messages:   	got:
        	            	 map[roundrobin.cloud.example.com:[10.1.0.1 10.1.0.2 10.1.0.3 10.0.0.1 10.0.0.2 10.0.0.3]] Gslb Records status,
        	            	
        	            	 want:
        	            	 map[roundrobin.cloud.example.com:[10.0.0.1 10.0.0.2 10.0.0.3 10.1.0.1 10.1.0.2 10.1.0.3]]

looks like ordering issue to me

@jkremser
Copy link
Member Author

another instance of the same thing (ordering of ips):
https://github.com/k8gb-io/k8gb/actions/runs/3276047689/jobs/5391825487

     	Messages:   	got:
        	            	 [
        	            		{
        	            			"dnsName": "localtargets-roundrobin.cloud.example.com",
        	            			"targets": [
        	            				"10.0.0.1",
        	            				"10.0.0.2",
        	            				"10.0.0.3"
        	            			],
        	            			"recordType": "A",
        	            			"recordTTL": 30
        	            		},
        	            		{
        	            			"dnsName": "roundrobin.cloud.example.com",
        	            			"targets": [
        	            				"10.1.0.1",
        	            				"10.1.0.2",
        	            				"10.1.0.3",
        	            				"10.0.0.1",
        	            				"10.0.0.2",
        	            				"10.0.0.3"
        	            			],
        	            			"recordType": "A",
        	            			"recordTTL": 30,
        	            			"labels": {
        	            				"strategy": "roundRobin"
        	            			}
        	            		}
        	            	] DNSEndpoint,
        	            	
        	            	 want:
        	            	 [
        	            		{
        	            			"dnsName": "localtargets-roundrobin.cloud.example.com",
        	            			"targets": [
        	            				"10.0.0.1",
        	            				"10.0.0.2",
        	            				"10.0.0.3"
        	            			],
        	            			"recordType": "A",
        	            			"recordTTL": 30
        	            		},
        	            		{
        	            			"dnsName": "roundrobin.cloud.example.com",
        	            			"targets": [
        	            				"10.0.0.1",
        	            				"10.0.0.2",
        	            				"10.0.0.3",
        	            				"10.1.0.1",
        	            				"10.1.0.2",
        	            				"10.1.0.3"
        	            			],
        	            			"recordType": "A",
        	            			"recordTTL": 30,
        	            			"labels": {
        	            				"strategy": "roundRobin"
        	            			}
        	            		}
        	            	]

@ytsarev ytsarev changed the title yet another non-deterministic tests failure flaky: yet another non-deterministic tests failure Dec 15, 2023
@ytsarev
Copy link
Member

ytsarev commented Dec 15, 2023

Can be reproduced locally by running

go test ./... -count=10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants