simba-testing

Test Simba distributed lock and leader election implementations with MockK and TCK conformance.

33|4|Updated Sep 3, 2021
One-click install
npx skills add https://github.com/Ahoo-Wang/Simba --skill simba-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: simba-testing
Source: https://github.com/Ahoo-Wang/Simba/tree/main/skills/simba-testing
Command: npx skills add https://github.com/Ahoo-Wang/Simba --skill simba-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing Simba distributed lock and leader election implementations is challenging due to timing-sensitive behavior, backend-specific setup requirements, and the need to verify both application logic and backend conformance without flaky tests.

Core Features & Use Cases

  • Unit Test Guidance: Provides MockK patterns for mocking MutexContendServiceFactory and simulating leadership changes to test application logic in isolation.
  • TCK Conformance Testing: Includes instructions for extending MutexContendServiceSpec to verify Redis, JDBC, and Zookeeper backend implementations meet all required behavior.
  • Integration & Scheduler Testing: Covers real backend integration test setup, AbstractScheduler leadership gating tests, and best practices for avoiding common test pitfalls like timing flakiness and resource leaks.
  • Use Case: A developer building a distributed task scheduler can use this skill to write fast unit tests for their leader election logic, run standardized TCK tests to validate a custom Simba backend, and debug intermittent lock release issues.

Quick Start

Use the simba-testing skill to write unit tests for your Simba-based distributed lock service, extend the TCK for your custom backend, or debug timing-sensitive leadership change behavior.

Frequently Asked Questions about simba-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test distributed lock logic without setting up a real Redis or Zookeeper backend?

You can test distributed lock logic in isolation by using MockK to mock MutexContendServiceFactory. This allows you to simulate leadership changes and verify application behavior quickly without backend setup.

How do I verify my custom Simba backend implementation meets distributed lock requirements?

Verify custom Simba backend implementations by extending the MutexContendServiceSpec. This conformance testing ensures your Redis, JDBC, or Zookeeper backends meet all required distributed lock and leader election behaviors.

Why are my distributed scheduler tests failing intermittently due to timing issues?

Intermittent distributed scheduler test failures often stem from timing flakiness and resource leaks. Apply proper timeout handling, test isolation, and consistent assertion styles to debug timing-sensitive leadership changes reliably.

Can I test AbstractScheduler leadership gating behavior in unit tests?

Yes, you can test AbstractScheduler leadership gating behavior. Use standardized mocking patterns to simulate leadership changes, ensuring your distributed task scheduler logic executes correctly only when leadership is acquired.

What is the best way to isolate leader election logic for fast unit testing in Kotlin?

The best way to isolate leader election logic is mocking the MutexContendServiceFactory with MockK. This approach provides test isolation, eliminates backend dependencies, and allows fast verification of leadership change handling.