-
Notifications
You must be signed in to change notification settings - Fork 11
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 unstable test + Add new test #250
Fix unstable test + Add new test #250
Conversation
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
@@ -112,14 +148,14 @@ func (eps *ExcludedPrefixesSuite) testCollectorWithFileOutput(ctx context.Contex | |||
eps.T().Fatalf("Error transforming yaml to prefixes: %v", err) | |||
} | |||
|
|||
eps.Require().LessOrEqual(modified, len(sources)*2) |
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.
How does we calculate the modification count?
Also, seems like actual and expected should be swaped (see at input params of the function)
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.
I've chosen this value because for each file write there may be two nsnotify.Write
events maximum. So for each source we need to have at least two possible write events.
Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>
…d-exclude-prefixes-k8s@main PR link: networkservicemesh/cmd-exclude-prefixes-k8s#250 Commit: c7b67bf Author: Denis Tingaikin Date: 2023-10-16 21:46:16 +0300 Message: - Merge pull request #250 from NikitaSkrynnik/fix-test Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Description
Fixed unstable test
TestAllSourcesWithFileOutput
. Also added a new test which checks that if collector receives several notification messages but no prefixes change it won't write the same prefixes to a file several times.Issue
#180