THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Note: All examples can be found here.
The goals of the Green Team
- Improve green consistency of distributed tests
- Mass test runs determined which tests we worked on
- Prioritized any tests that failed more than once in our mass test runs
- Fixed about 35 issues (working on more)
- Spent about a quarter of our time fixing product bugs
- Anecdotal improvements for Geode developers
- “CIO board is cleaner”
- “Seeing more Green pull requests”
...
"What you can do to make things better?"
Avoid thread sleeping
- Awaitility -- await for some state to change
- CountDownLatch -- coordinate between VMs and/or threads
- Mockito Spy and Verify
- Verify with timeout can be used instead of Awaitility
- Wrap anything with spy or use it to implement a callback such as CacheListener
- Verify is used to validate number of invocations with optional timeout
- All timeouts should use GeodeAwaitility.getTimeout()
- Possible exceptions to the rule
- Busy waiting in loops (Awaitility is usually a better option than custom looping)
- Slow receiver/listener type testing (there’s probably a better way to do it)
...
Use ExecutorServiceRule for multithreading
- Use ExecutorServiceRule or DistributedExcutorServiceRule
- Provides debugging support for hangs
- Cleans up threads on tear down
- Test task code should be interruptible
- Use Future or CompletableFuture for submitted runnable/callable
- Always invoke get() on any Future or CompletableFuture
...
- Avoid catching exception and setting some test state to check later
- Use ErrorCollector in unit and integration tests
- Use SharedErrorCollector DistributedErrorCollector in distributed tests
Examples: AsyncErrorHandlingIntegrationTest, AsyncErrorHandlingDistributedTest
...
- DistributedRule -- simply launches DUnit and greps for suspect strings after each test method
- DistributedExecutorServiceRule -- provides an ExecutorService for all VMs
- DistributedRestoreSystemProperties -- restores system properties in all VMs
- SharedCountersRule DistributedCounters -- shares counters across all VMs
- SharedErrorCollectorDistributedErrorCollector -- shares one JUnit ErrorCollector across all VMs
Testing tools
...
for Cloud
...
testing
Mass test run pipeline
- Find and prioritize problematic tests
- Defined under Geode CI
- Matches the CI pipelines
...