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

The results seem to be random #20

Closed
ldez opened this issue Jan 20, 2021 · 4 comments · Fixed by #21
Closed

The results seem to be random #20

ldez opened this issue Jan 20, 2021 · 4 comments · Fixed by #21

Comments

@ldez
Copy link
Contributor

ldez commented Jan 20, 2021

Short summary

The results seem to be random: two calls don't provide the same results.

I found the issue during the analysis of this issue golangci/golangci-lint#1653

Steps to reproduce the behavior

# https://github.com/kopia/kopia
$ git@github.com:kopia/kopia.git
$ git checkout 1f3b8d4d
$ mnd ./...

go-mnd version or commit ref

I use my PR #19 because without that I was not able to run the CLI.

Go version (output of 'go version')

$ go version
go version go1.15.7 linux/amd64

Operating system / Environment

$ go version
go version go1.15.7 linux/amd64

Expected behavior

$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
13
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
13

Actual behavior

linux
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
12
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
12
$ GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep splitter.go  | wc -l
13
darwin
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
10
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
13
$ GOARCH=amd64 GOOS=darwin mnd ./... 2>&1 | grep splitter.go  | wc -l
12
windows
$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
10
$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
12
$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
13
$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
12
$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
12
$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
13
$ GOARCH=amd64 GOOS=windows mnd ./... 2>&1 | grep splitter.go | wc -l
13
@jkowalski
Copy link

Note: to repro this with Kopia repo use kopia/kopia@1f3b8d4 instead of latest master, since we've merged the fix to make linter no longer flaky in kopia/kopia@04b99c7

@ldez
Copy link
Contributor Author

ldez commented Jan 22, 2021

The root cause seems to be the argument checker:

condition
for i in {1..10}; do GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep 'in <condition> detected'  | wc -l; done
5
5
5
5
5
5
5
5
5
operation
for i in {1..10}; do GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep 'in <operation> detected'  | wc -l; done
18
18
18
18
18
18
18
18
18
18
argument
for i in {1..10}; do GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep 'in <argument> detected'  | wc -l; done
37
40
36
37
38
36
39
37
39
38
return
for i in {1..10}; do GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep 'in <return> detected'  | wc -l; done
4
4
4
4
4
4
4
4
4
4
assign
$ for i in {1..10}; do GOARCH=amd64 GOOS=linux mnd ./... 2>&1 | grep 'in <assign> detected'  | wc -l; done
17
17
17
17
17
17
17
17
17
17

@ldez
Copy link
Contributor Author

ldez commented Jan 22, 2021

I found the problem I will open a PR

@tommy-muehle
Copy link
Owner

PR is merged and new release published! Thanks for the fix.

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 a pull request may close this issue.

3 participants