Skip to content

clouddriver v5.67.0

Compare
Choose a tag to compare
@claymccoy claymccoy released this 20 Jul 16:40
· 1079 commits to master since this release
966cf48
fix(elasticsearch): Fix race conditions in elasticsearch tests (#4751)

The elasticsearch tests are failing intermittently because there
are numerous race conditions between when index refreshes cause
a mutating operation to be visible, and when we assert that the
operation is visible.

Currently the test cluster is set up to reindex every 1s, and we
are using sleep statements and retries to ensure we wait that long
before failing a test. In addition to making these tests slow, there
are intermittent failures (particularly under high load) when we
fail before the re-index has occurred.

Let's make this deterministic as follows:
(1) Manually refresh the index before verifying the status of an
operation.
(2) Set the refresh_interval to -1, which means never automatically
refresh. This ensures that tests will always fail if we forget to
invoke the manual refresh to avoid future intermittent tests.

As an added benefit, this speeds up the tests significantly, as
we're no longer unnecessarily waiting. In my very rough testing,
the time to execute tests in this class is reduced from ~35s to
~7s.