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

Implicit gtest_filter fails when running 300 tests #423

Closed
5 tasks done
SaturnIC opened this issue Feb 12, 2024 · 6 comments
Closed
5 tasks done

Implicit gtest_filter fails when running 300 tests #423

SaturnIC opened this issue Feb 12, 2024 · 6 comments
Labels
incomplete Make sure you followed the issue template

Comments

@SaturnIC
Copy link

SaturnIC commented Feb 12, 2024

Checklist

  • The issue is about this extension and NOT about a fork.
  • Checked the ALL the SUPPORT document.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue
  • Imagine yourself into my position and think how hard to debug the issue without insufficient information.
    I understand that you have privacy concerns and I expect you to understand that this extension is developed for free.
    Thanks.

Describe the bug

  • Running googletests on windows pc.
  • All tests pass from the commandline (Just running the compiled exe)
  • 9 / 300 Tests fail by running the test suite with test adapter out of vscode.
    • Found out the test invocation from test adapter uses --gtest_filter=<test-suite>.<test-case>:... parameters
      for every single test case(!)
      Running the test suite on the cli with the same filter parameters causes tests to fail on the cli as well
    • Found out the test invocation from test adapter uses --gtest_color=no parameter,
      disabling this parameter on the CLI lets only 1/300 fail
  • Running the tests with --gtest_filter=* --gtest_color=no lets all tests pass
    => The gtest_filter parameter with many positive filter strings seems to cause flaky tests
  • Running only the tests in the failed test suite by themselves (14 tests) in the VSCode test adapter GUI lets all those tests pass (they failed before)
  • Question: Could the filter string in the "run all tests view" be disabled or replaced with * since it seems buggy to use gtest_filter with lots of tests?
@SaturnIC SaturnIC changed the title Messed up order of executing tests Implicit gtest_filter fails when using 300 tests Feb 12, 2024
@SaturnIC SaturnIC changed the title Implicit gtest_filter fails when using 300 tests Implicit gtest_filter fails when running 300 tests Feb 12, 2024
@matepek matepek added the incomplete Make sure you followed the issue template label Feb 13, 2024
@matepek
Copy link
Owner

matepek commented Feb 13, 2024

Hello,

It can be that your tests are depending on each other and thats why it's flaky and not because of this extension.
You can try command line with shuffle to reproduce the same issue. You can try running the same command line with filter the extension does and figuring out why your tests are flaky.

This filtering feature is a base of other features which would not work so I need solid proof it is not working properly to start to work on some alternatives.

Let me know if you found the issue or need more advice, meanwhile I don't consider this an issue of the extension.

@matepek matepek closed this as completed Feb 13, 2024
@SaturnIC
Copy link
Author

SaturnIC commented Jul 10, 2024

Yes the tests are dependent, but the vscode extension M U S T not change the order of running those tests,
by using filters underneath the hood the cause a random execution order.

The order of executing the tests through VSCode should be the same as executing the tests without any filters.

@matepek
Copy link
Owner

matepek commented Jul 10, 2024

Point 2

@SaturnIC
Copy link
Author

SaturnIC commented Jul 10, 2024

Only beginners care about some arbitrary rules.
("Clean Code" is an egregious example for the harm caused by baseless philosophy being pushed with religious fervor)

Software is all about predictability and deterministic behavior.

And vscode gtest extension shuffling execution orders is an issue that must be fixed.

@matepek
Copy link
Owner

matepek commented Jul 10, 2024

GoogleTest framework does not define execution order (if I'm correct), therefore developers should not depend on it.

@SaturnIC
Copy link
Author

The order is fixed after compilation of the tests,
so run them in the order they have been set in the binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete Make sure you followed the issue template
Projects
None yet
Development

No branches or pull requests

2 participants