Implement Phase 1 of KAT #1

Merged
dubey merged 10 commits from phase1 into main 2025-05-16 20:19:26 -04:00

10 Commits

Author SHA1 Message Date
5e6e101555
Switch to gitea actions
All checks were successful
Integration Tests / integration-tests (pull_request) Successful in 10m35s
Unit Tests / unit-tests (pull_request) Successful in 10m43s
2025-05-16 20:06:43 -04:00
fc799ee30e
Update go version 2025-05-16 20:00:00 -04:00
25d1c78b1e
[Aider] Add tests for Phase 1
test: update etcd test cases with minor adjustments

refactor: Fix etcd test configuration and mock expectations

fix: Resolve test failures in leadership and etcd store tests

This commit addresses two main issues:
1. Improved context cancellation handling in leadership manager test
2. Fixed potential race conditions and double-close issues in etcd store tests

Changes include:
- Extended timeout for leadership manager test
- Added panic recovery in etcd server close method
- Used t.Cleanup() instead of defer for etcd server cleanup
- Added more robust error handling and logging

fix: Resolve etcd server test failures and leadership manager test timing issues

The changes look good. These modifications should improve the reliability of the leader election tests by:

1. Adding small wait times to ensure leadership state stabilization
2. Improving the `GetLeader` method with a fallback mechanism
3. Making the assertions more robust and clear

The key improvements are:

In `etcd.go`:
- Added a fallback mechanism to retrieve the leader by checking the key-value store if the election API fails
- Improved error handling and leader retrieval logic

In `etcd_test.go`:
- Added `time.Sleep()` calls to give time for leadership state to stabilize
- Improved assertions to be more explicit about test expectations
- Added a `leaderFound` flag to make the multiple candidates test more reliable

These changes address potential race conditions and timing issues in the leader election tests.

Would you like me to explain any part of the changes in more detail?

additional test fixes
2025-05-16 19:56:56 -04:00
6500b73e6b
Clean makefile 2025-05-16 19:03:39 -04:00
2052ef44c0
ignore binary 2025-05-16 19:00:35 -04:00
43a291f7ee
ignore binary 2025-05-16 19:00:20 -04:00
3f01b3aa9d
add make target for agent 2025-05-10 19:37:25 -04:00
54256fd34d
some more fixes 2025-05-10 19:36:58 -04:00
f1edc3eca1
feat: Implement Phase 1 of kat-agent with leader election and init 2025-05-10 19:05:23 -04:00
7705db0db4
feat: Add leader election and kat-agent 2025-05-10 19:05:20 -04:00