opensearch-project / security

🔐 Secure your cluster with TLS, numerous authentication backends, data masking, audit logging as well as role-based access control on indices, documents, and fields
https://opensearch.org/docs/latest/security-plugin/index/
Apache License 2.0
180 stars 264 forks source link

Fixed flaky BWC test. #4446

Closed nibix closed 2 weeks ago

nibix commented 2 weeks ago

Description

Fixes flaky BWC test. Fixes #4445

The test SecurityBackwardsCompatibilityIT.testDataIngestionAndSearchBackwardsCompatibility had a 1:100 chance to send empty bulk request bodies which would result in 400 Bad Request errors.

Issues Resolved

Testing

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

nibix commented 2 weeks ago

BTW, what's up with these windows int tests? These seem to fail quite often:


Tests with failures:
 - org.opensearch.security.DefaultConfigurationSingleNodeClusterTests.securityRolesUpgrade
 - org.opensearch.security.DefaultConfigurationSingleNodeClusterTests.shouldLoadDefaultConfiguration
 - org.opensearch.security.DefaultConfigurationSingleNodeClusterUseClusterStateTests.securityRolesUpgrade
 - org.opensearch.security.DefaultConfigurationSingleNodeClusterUseClusterStateTests.shouldLoadDefaultConfiguration
 - org.opensearch.security.api.SslCertsRestApiIntegrationTest.classMethod
 - org.opensearch.security.SecurityConfigurationTests.testParallelTenantPutRequests
 - org.opensearch.security.api.ConfigRestApiIntegrationTest.classMethod
 - org.opensearch.security.api.DefaultApiAvailabilityIntegrationTest.securityConfigIsNotAvailableByDefault
cwperks commented 2 weeks ago

@nibix There was a BindException on the test run. I restarted the CI Check for Windows integ tests JDK 17

This is a known issue that still needs to be addressed: https://github.com/opensearch-project/security/issues/4259

org.opensearch.transport.BindTransportException: Failed to bind to 127.0.0.1:47300
    at org.opensearch.transport.TcpTransport.bindToPort(TcpTransport.java:487) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
    at org.opensearch.transport.TcpTransport.bindServer(TcpTransport.java:451) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
    at org.opensearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:166) ~[transport-netty4-client-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
    at org.opensearch.common.lifecycle.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:77) ~[opensearch-common-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
    at org.opensearch.transport.TransportService.doStart(TransportService.java:306) ~[opensearch-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
    at org.opensearch.common.lifecycle.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:77) ~[opensearch-common-3.0.0-SNAPSHOT.jar:3.0.0-SNAPSHOT]
    at org.opensearch.node.Node.start(Node.java:1523) ~[opensearch-3.0.0-SNAPSHOT.jar:?]
    at org.opensearch.test.framework.cluster.LocalOpenSearchCluster$Node$1.run(LocalOpenSearchCluster.java:428) [integrationTest/:?]
    at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.net.BindException: Address already in use: bind
codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 65.46%. Comparing base (94f7ccb) to head (afcf598). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/opensearch-project/security/pull/4446/graphs/tree.svg?width=650&height=150&src=pr&token=rBpySfQXMt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project)](https://app.codecov.io/gh/opensearch-project/security/pull/4446?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) ```diff @@ Coverage Diff @@ ## main #4446 +/- ## ========================================== + Coverage 65.45% 65.46% +0.01% ========================================== Files 312 312 Lines 22042 22042 Branches 3559 3559 ========================================== + Hits 14427 14430 +3 + Misses 5843 5841 -2 + Partials 1772 1771 -1 ``` [see 3 files with indirect coverage changes](https://app.codecov.io/gh/opensearch-project/security/pull/4446/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project)
willyborankin commented 2 weeks ago

@nibix and @cwperks I found the bug in tests. I will open PR. It appears only on windows