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

fix minor code unreachability error #11040

Merged
merged 1 commit into from
Aug 2, 2022
Merged

Conversation

Abirdcfly
Copy link
Contributor

@Abirdcfly Abirdcfly commented Jul 20, 2022

Signed-off-by: Abirdcfly fp544037857@gmail.com

https://pkg.go.dev/testing#T.Fatalf

Fatalf is equivalent to Logf followed by FailNow.

https://pkg.go.dev/testing#T.FailNow

FailNow marks the function as having failed and stops its execution by calling runtime.Goexit (which then runs all deferred calls in the current goroutine).

if tg2.Source != tg1.Source {
t.Fatalf("Source is different: %s != %s", tg1.Source, tg2.Source)
if len(tg2.Targets) > 0 {
t.Fatalf("Got a non-empty target set: %s", tg2.Targets)
}
}

So if line 162 use Fatalf, line163 to line 165 will never run.

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
@Abirdcfly
Copy link
Contributor Author

TestUpdateMissedEvalMetrics Failed in test_windows @roidelapluie https://app.circleci.com/pipelines/github/prometheus/prometheus/17742/workflows/1397c0eb-0e24-42b9-b50c-43135bb63cbb/jobs/86103

I think rerun will fix it. But I do not have permission.

@roidelapluie roidelapluie enabled auto-merge (squash) August 2, 2022 11:12
@roidelapluie
Copy link
Member

Thanks

@roidelapluie roidelapluie merged commit 465558e into prometheus:main Aug 2, 2022
Mama59 pushed a commit to Arnoways/prometheus that referenced this pull request Aug 25, 2022
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
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.

2 participants