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

Make tablet test provide more details on failure #209

Conversation

dkropachev
Copy link
Collaborator

@dkropachev dkropachev commented Jul 6, 2024

Time to time this test fails due to not obviouse reason
To make it possible investigate the issue we need to drop more details when it happens
Failure example:

tablet_integration_test.go:72: expected queriedHosts to be (1) but was (0) instead

@@ -69,7 +69,9 @@ func TestTablets(t *testing.T) {
}
}

assertEqual(t, "queriedHosts", 1, queriedHosts)
if queriedHosts != 1 {
t.Errorf("trace should show only once host from the list %s, but it showed it %d, trace:\n%s", hostAddresses, queriedHosts, buf.String())
Copy link
Collaborator

Choose a reason for hiding this comment

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

you mean "one host" and "but it showed %d"? It is not about how many times it showed given host, but how many hosts it showed

Copy link
Collaborator

Choose a reason for hiding this comment

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

and I would consider using Fatalf to fail on first unsuccessful query

Copy link
Collaborator Author

@dkropachev dkropachev Jul 8, 2024

Choose a reason for hiding this comment

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

I have changed language, take a look.

@dkropachev dkropachev force-pushed the dk/tablet-test-to-return-more-details branch from 286f98d to 29f1112 Compare July 8, 2024 10:21
@@ -69,7 +69,9 @@ func TestTablets(t *testing.T) {
}
}

assertEqual(t, "queriedHosts", 1, queriedHosts)
if queriedHosts != 1 {
t.Fatalf("trace should show host only once but it showed it %d, hosts: %s trace:\n%s", queriedHosts, hostAddresses, buf.String())
Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant: "trace should show only one host, but it showed %d, hosts: %s trace: \n%s"
Host can be present in the trace multiple times but it has to be the same host

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, changed language again, take a look.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be nice to have similar change in the second test in this file, could you add it?

@dkropachev dkropachev force-pushed the dk/tablet-test-to-return-more-details branch from 29f1112 to 5a0d8be Compare July 8, 2024 10:48
Time to time this test fails due to not obviouse reason
To make it possible investigate the issue we need to drop more details
when it happens
@dkropachev dkropachev force-pushed the dk/tablet-test-to-return-more-details branch from 5a0d8be to 1d1ee11 Compare July 8, 2024 11:03
@sylwiaszunejko sylwiaszunejko merged commit c2e98cb into scylladb:master Jul 8, 2024
1 check passed
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.

3 participants