Skip to content

Conversation

feg208
Copy link
Contributor

@feg208 feg208 commented Apr 22, 2024

@jimingham I am wondering if you are ok removing this test? It caused failures in some of the build bots because the user time was less than a microsecond. Alternatively we can increase the number of loops or maybe I need some other approach? I had commented it out just to not impact others

@feg208 feg208 requested a review from jimingham April 22, 2024 17:46
@feg208 feg208 requested a review from JDevlieghere as a code owner April 22, 2024 17:46
@llvmbot llvmbot added the lldb label Apr 22, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 22, 2024

@llvm/pr-subscribers-lldb

Author: Fred Grim (feg208)

Changes

@jimingham I am wondering if you are ok removing this test? It caused failures in some of the build bots because the user time was less than a microsecond. Alternatively we can increase the number of loops or maybe I need some other approach? I had commented it out just to not impact others


Full diff: https://github.com/llvm/llvm-project/pull/89637.diff

1 Files Affected:

  • (modified) lldb/unittests/Host/linux/HostTest.cpp (-14)
diff --git a/lldb/unittests/Host/linux/HostTest.cpp b/lldb/unittests/Host/linux/HostTest.cpp
index 733909902474d7..5599e4349c8291 100644
--- a/lldb/unittests/Host/linux/HostTest.cpp
+++ b/lldb/unittests/Host/linux/HostTest.cpp
@@ -68,18 +68,4 @@ TEST_F(HostTest, GetProcessInfo) {
   EXPECT_TRUE(Info.GetArchitecture().IsValid());
   EXPECT_EQ(HostInfo::GetArchitecture(HostInfo::eArchKindDefault),
             Info.GetArchitecture());
-  // Test timings
-  /*
-   * This is flaky in the buildbots on all archs
-  ASSERT_TRUE(Host::GetProcessInfo(getpid(), Info));
-  ProcessInstanceInfo::timespec user_time = Info.GetUserTime();
-  static volatile unsigned u = 0;
-  for (unsigned i = 0; i < 10'000'000; i++) {
-    u = i;
-  }
-  ASSERT_TRUE(Host::GetProcessInfo(getpid(), Info));
-  ProcessInstanceInfo::timespec next_user_time = Info.GetUserTime();
-  ASSERT_TRUE(user_time.tv_sec < next_user_time.tv_sec ||
-              user_time.tv_usec < next_user_time.tv_usec);
-  */
 }

@JDevlieghere
Copy link
Member

A potential compromise would be to check that the time is great or equal?

@feg208
Copy link
Contributor Author

feg208 commented Apr 24, 2024

A potential compromise would be to check that the time is great or equal?

That's a good idea. I'll make that change and add a note

@felipepiovezan
Copy link
Contributor

Hi @feg208 , I noticed that your previous commit has a very.. unusual commit title and message. The same thing applies to this PR.

I'd appreciate it if you could follow a more standard commit title and message, so that the logs are more easily parseable.
Here's the official LLVM docs on the matter: https://llvm.org/docs/DeveloperPolicy.html#commit-messages

You can also get a good sample by doing a git log --one-line inside the llvm repo.

@feg208 feg208 force-pushed the users/feg208/remove_commented_code branch from 21ae49b to 9ef4220 Compare April 24, 2024 16:01
@feg208
Copy link
Contributor Author

feg208 commented Apr 24, 2024

Hi @feg208 , I noticed that your previous commit has a very.. unusual commit title and message. The same thing applies to this PR.

I'd appreciate it if you could follow a more standard commit title and message, so that the logs are more easily parseable. Here's the official LLVM docs on the matter: https://llvm.org/docs/DeveloperPolicy.html#commit-messages

You can also get a good sample by doing a git log --one-line inside the llvm repo.

Sure thing. I apologize for deviating from expectations.

@feg208 feg208 force-pushed the users/feg208/remove_commented_code branch from 9ef4220 to bd0416d Compare April 24, 2024 16:09
@feg208 feg208 changed the title I left some commented code in. This test doesn't run reliably in the different build bots [lldb] Reenable test HostTest.GetProcessInfo with relaxed constraints This test was commented out which, besides being bad form, disabled the test entirely. But we do want to validate that this timings are not decreasing. The test is modified to reflect those expectations. Apr 24, 2024
@feg208 feg208 changed the title [lldb] Reenable test HostTest.GetProcessInfo with relaxed constraints This test was commented out which, besides being bad form, disabled the test entirely. But we do want to validate that this timings are not decreasing. The test is modified to reflect those expectations. [lldb] Reenable test HostTest.GetProcessInfo with relaxed constraints. Apr 24, 2024
@feg208 feg208 force-pushed the users/feg208/remove_commented_code branch from bd0416d to edc21c6 Compare April 24, 2024 16:12
This test was commented out which, besides being bad form, disabled the
test entirely. But we do want to validate that this timings are not
decreasing. The test is modified to reflect those expectations.
@feg208 feg208 force-pushed the users/feg208/remove_commented_code branch from edc21c6 to 4117578 Compare April 24, 2024 17:04
@feg208 feg208 merged commit a5c4f96 into llvm:main Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants