-
Notifications
You must be signed in to change notification settings - Fork 431
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
bastionhosts_test.go
tests give false results when running tests in parallel
#1753
Comments
I have fixed the |
/assign |
I think I'll raise a separate PR for this to fix this issue separately, instead of coupling the fix with #1745 |
Signed-off-by: Karuppiah Natarajan <[email protected]>
Signed-off-by: Karuppiah Natarajan <[email protected]>
Signed-off-by: Karuppiah Natarajan <[email protected]> Signed-off-by: Karuppiah Natarajan <[email protected]>
For example, if you run the below command to run
TestReconcileBastionHosts
test on commit df75af2 which is the latest commit onmain
branch as of this writinggo test -run ^TestReconcileBastionHosts$ sigs.k8s.io/cluster-api-provider-azure/azure/services/bastionhosts
You will get an output like this
$ go test -run ^TestReconcileBastionHosts$ sigs.k8s.io/cluster-api-provider-azure/azure/services/bastionhosts ok sigs.k8s.io/cluster-api-provider-azure/azure/services/bastionhosts 0.424s
Now remove the
t.Parallel
in theTestReconcileBastionHosts
test's sub tests, that is this line -cluster-api-provider-azure/azure/services/bastionhosts/bastionhosts_test.go
Line 248 in df75af2
Now run the same command again to run
TestReconcileBastionHosts
testgo test -run ^TestReconcileBastionHosts$ sigs.k8s.io/cluster-api-provider-azure/azure/services/bastionhosts
And you will get an output like this
Which shows that there are failures. And I believe these are valid failures as I can see from the corresponding source code that
CreateOrUpdate
method of publicips client is never called, so the failures sayingmissing call(s) to *mock_publicips.MockClient.CreateOrUpdate...
are trueWe need to investigate this issue, as this kind of denotes that we cannot trust the tests because they can give false results - in the above case - a false result where failing tests are shown as passing when running in parallel
The text was updated successfully, but these errors were encountered: