-
Notifications
You must be signed in to change notification settings - Fork 224
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
KM Multi-threaded stress tests - Code clean-up, duplicate code refactoring #2467
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2467 +/- ##
==========================================
- Coverage 84.02% 83.97% -0.06%
==========================================
Files 155 155
Lines 28868 28868
==========================================
- Hits 24257 24242 -15
- Misses 4611 4626 +15 |
[&](uint32_t local_restart_delay, uint32_t local_thread_lifetime) { | ||
// Delay the start of this thread for a bit to allow the ebpf programs to attach successfully. There's a | ||
// window where if the extension is unloading/unloaded, an incoming attach might fail. | ||
std::this_thread::sleep_for(std::chrono::seconds(3)); |
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.
This implies the test is non-deterministic and if the CPU is pegged then the test can fail, is that correct? If so, there's probably a better solution in the future than introducing an arbitrary delay.
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.
No, the test itself wouldn't fail. It would just carry on with the start of the 'extension restart' thread delayed even further. Given that the minimum test runtime is 1 minute, IMO it's more than enough for the restart thread to start running eventually. In any case, system load affecting thread scheduling would affect the test threads as well, so their delays would balance out.
FWIW, I did think of synchronizing this thread with the test threads but thought it was overkill given the 'test only' nature of this code. But I can certainly file an issue to revisit that synchronization if it is seen to cause issues during actual testing.
Description
Code clean-up and common code refactoring of the tests in the 'Kernel mode Multi-threaded stress tests' suite.
Testing
clean-up of existing test collateral.
Documentation
No doc changes.
Fixes #2463