You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Refactor FeatureFlags.java.
- Remove internal immutable `settings` in favor of `ConcurrentHashMap`.
- Move functionality to internal `FeatureFlagsImpl` class.
Expose public api of `FeatureFlagsImpl` in FeatureFlags.
Expose test api of `FeatureFlagsImpl` in FeatureFlags.TestUtils.
- Read and set JVM system properties once on `initializeFeatureFlags`.
Remove JVM system properties check from `isEnabled`.
- Add `FlagLock` in `TestUtils` to maintain a lock for each feature flag.
- Add helper functions to set & access feature flags in a thread safe way.
`TestUtils.with(<feature flag>, () -> {})` to execute crtical sections.
`New FlagLock(<feature flag>)` for fine grained control.
Signed-off-by: Finn Carroll <[email protected]>
* Add @LockFeatureFlag annotation
- Add annotation in OpenSearchTestCase to enable and lock a flag for the
duration of a single test case.
Signed-off-by: Finn Carroll <[email protected]>
* Update FeatureFlagTests
- Add cases for public api.
- Add cases for thread safe helpers
@LockFeatureFlag
FlagLock
TestUtils.with
Signed-off-by: Finn Carroll <[email protected]>
* Remove FeatureFlagSetter
Signed-off-by: Finn Carroll <[email protected]>
* Find and replace feature flag test case usages with appropriate helper
Replace all usages of `FeatureFlagSetter` in tests.
Replace all usages of JVM system properties for feature flags in tests.
Replace all usages of `initializeFeatureFlags` with `TestUtils.set` in tests.
Signed-off-by: Finn Carroll <[email protected]>
* Add changelog entry
Signed-off-by: Finn Carroll <[email protected]>
* Fix lingering test failures
- Add missing LockFeatureFlag annotations.
- Cannot use annotation in tests which expect exception thrown.
- SEARCHABLE_SNAPSHOT_EXTENDED_COMPATIBILITY has no setting? Adding.
- Flight server tests need flag enabled on setup.
Signed-off-by: Finn Carroll <[email protected]>
* Remove concurrency primitives
JUnit does not run tests in parallel on the same JVM so these are not
necessary. Additionally rename to `FlagWriteLock` for clarity.
Signed-off-by: Finn Carroll <[email protected]>
* Fix flight service IT.
Address ff contant nit.
Signed-off-by: Finn Carroll <[email protected]>
* Nit.
Signed-off-by: Finn Carroll <[email protected]>
* Add blurb to DEVELOPER_GUIDE.md regarding ff test utils.
Signed-off-by: Finn Carroll <[email protected]>
---------
Signed-off-by: Finn Carroll <[email protected]>
Copy file name to clipboardExpand all lines: DEVELOPER_GUIDE.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -594,7 +594,8 @@ Rapidly developing new features often benefit from several release cycles before
594
594
uses an Experimental Development process leveraging [Feature Flags](https://featureflags.io/feature-flags/). This allows a feature to be developed using the same process as
595
595
a LTS feature but with additional guard rails and communication mechanisms to signal to the users and development community the feature is not yet stable, may change in a future
596
596
release, or be removed altogether. Any Developer or User APIs implemented along with the experimental feature should be marked with `@ExperimentalApi` (or documented as
597
-
`@opensearch.experimental`) annotation to signal the implementation is not subject to LTS and does not follow backwards compatibility guidelines.
597
+
`@opensearch.experimental`) annotation to signal the implementation is not subject to LTS and does not follow backwards compatibility guidelines. When writing tests for
598
+
functionality gated behind a feature flag please refer to `FeatureFlags.TestUtils` and the `@LockFeatureFlag` annotation.
Copy file name to clipboardExpand all lines: plugins/arrow-flight-rpc/src/internalClusterTest/java/org/opensearch/arrow/flight/ArrowFlightServerIT.java
Copy file name to clipboardExpand all lines: plugins/arrow-flight-rpc/src/test/java/org/opensearch/arrow/flight/bootstrap/FlightClientManagerTests.java
0 commit comments