-
Notifications
You must be signed in to change notification settings - Fork 121
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
[DO NOT MERGE] testing flaky tests #1260
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ package client_test | |
|
||
import ( | ||
"context" | ||
"net" | ||
"testing" | ||
"time" | ||
|
||
|
@@ -44,12 +43,14 @@ func TestClient(t *testing.T) { | |
) | ||
|
||
defer grpcServer.Stop() | ||
go func() { | ||
ls, err := net.Listen("tcp", appFlags.GrpcAddress) | ||
require.NoError(t, err) | ||
err = grpcServer.Serve(ls) | ||
require.NoError(t, err) | ||
}() | ||
/* | ||
go func() { | ||
ls, err := net.Listen("tcp", appFlags.GrpcAddress) | ||
require.NoError(t, err) | ||
err = grpcServer.Serve(ls) | ||
require.NoError(t, err) | ||
}() | ||
*/ | ||
Comment on lines
+46
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes from lines 47 to 54 involve commenting out the gRPC server setup within a goroutine. While this might be an attempt to address flaky tests, it's essential to investigate the root cause of the flakiness. Disabling parts of the test setup can reduce the test's effectiveness in simulating real-world scenarios. Consider alternative solutions that maintain the integrity of the test setup, such as adjusting timeouts, using more deterministic data, or isolating external dependencies. Would you like assistance in exploring alternative solutions to address the test flakiness while keeping the test setup intact? |
||
|
||
slinky.On("Stop").Return(nil) | ||
slinky.On("Start", mock.Anything).Return(nil).Once() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The gRPC server is created without specifying credentials, which could lead to insecure communication. Even though this is a test environment, adopting best practices for secure communication is beneficial. Consider adding SSL/TLS credentials to the gRPC server setup. Here's an example of how to add credentials to the server:
Ensure you have the
cert.pem
andcert.key
files available in your test environment. This change enhances the security of your gRPC communication during testing.