Use standard helper function for verifying that the TLS rotation worked#3090
Use standard helper function for verifying that the TLS rotation worked#3090madolson wants to merge 2 commits intovalkey-io:unstablefrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors TLS test code to use the standard wait_for_log_messages helper function instead of custom log file reading logic. The changes improve code maintainability by eliminating duplicated file handling code and using the established test utility.
Changes:
- Replaced manual log file reading and pattern matching with
wait_for_log_messageshelper calls - Simplified waiting for TLS reload completion messages in multiple test scenarios
- Maintained equivalent behavior while reducing code complexity
| wait_for_condition 50 100 { | ||
| set fd [open $logfile r] | ||
| set logs [read $fd] | ||
| close $fd | ||
| [string match {*TLS materials reloaded successfully*} $logs] | ||
| } else { |
There was a problem hiding this comment.
This can never have worked. The condition can't contain variable assignments. Didn't we run the TLS tests at all before merging the PR?
invalid bareword "set"
in expression "
set fd [open $logfile r]
...";
should be "$set" or "{set}" or "set(...)" or ...
while executing
"wait_for_condition 50 100 {
set fd [open $logfile r]
set logs [read $fd]
close $fd
There was a problem hiding this comment.
Yeah, it never could have worked. Looks like no tests run with TLS, I thought we ran some permutation.
Also, I'm really confused at the new failures.
Run extra test label doesn't seem to work correctly anymore. It just runs on unstable, it doesn't merge in the change.
There was a problem hiding this comment.
Wow, it was running on the wrong branch. Yeah I see where we broke it. 🤦 Very not fun to find out the extra tests hasn't worked for a while... Good to see it fixed quickly in #2907!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #3090 +/- ##
=========================================
Coverage 74.39% 74.39%
=========================================
Files 129 129
Lines 71011 71011
=========================================
+ Hits 52826 52831 +5
+ Misses 18185 18180 -5 🚀 New features to boost your workflow:
|
…ns successfull Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
|
Hi @madolson, I’ve fixed the unit tests in #3094. Sorry for the inconvenience. I had issues running the unit tests locally(I’m not sure if this is a common issue for macOS users - #2999 (comment)), so I relied on CI for validation, but I didn’t realize that the CI jobs don’t include the TLS tests. |
|
@yang-z-o thanks! I got distracted since our ci wasnt working correctly :) we can move to your pr |
The test was previously rolling it's own log checking, but we have helper functions. I noticed a few other instances, but there are active test failures so just targeting that right now.