Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

...

Examples: AsyncErrorHandlingIntegrationTest, AsyncErrorHandlingDistributedTest

...

Testing tools - Cloud

...

testing

Mass test run pipeline

  • Find and prioritize problematic tests
  • Defined under Geode CI
  • Matches the CI pipelines

...