Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEST] fix RequestConvertersTests failure #42

Closed
wants to merge 1 commit into from
Closed

[TEST] fix RequestConvertersTests failure #42

wants to merge 1 commit into from

Conversation

tlfeng
Copy link
Collaborator

@tlfeng tlfeng commented Feb 4, 2021

Issue #, if available:
#23

[Update: There is another approach to deal with the failure, see issue #52]
There are 4 flaky tests failure in "REST Hight Level Client Tests" (Gradle Task :client:rest-high-level:test)

> Task :client:rest-high-level:test

REPRODUCE WITH: ./gradlew ':client:rest-high-level:test' --tests "org.elasticsearch.client.RequestConvertersTests.testSourceExistsWithType" -Dtests.seed=6441E51410EE961B -Dtests.security.manager=true -Dtests.locale=es-US -Dtests.timezone=SystemV/MST7 -Druntime.java=15

org.elasticsearch.client.RequestConvertersTests > testSourceExistsWithType FAILED
    java.lang.AssertionError: expected:<{realtime=false, refresh=true}> but was:<{realtime=false}>
        at __randomizedtesting.SeedInfo.seed([6441E51410EE961B:D80B1368D804414D]:0)
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.elasticsearch.client.RequestConvertersTests.doTestSourceExists(RequestConvertersTests.java:218)
        at org.elasticsearch.client.RequestConvertersTests.testSourceExistsWithType(RequestConvertersTests.java:172)

REPRODUCE WITH: ./gradlew ':client:rest-high-level:test' --tests "org.elasticsearch.client.RequestConvertersTests.testGetSource" -Dtests.seed=6441E51410EE961B -Dtests.security.manager=true -Dtests.locale=es-US -Dtests.timezone=SystemV/MST7 -Druntime.java=15

org.elasticsearch.client.RequestConvertersTests > testGetSource FAILED
    java.lang.AssertionError: expected:<{routing=bdpSOmeC, preference=haod, refresh=true}> but was:<{routing=bdpSOmeC, preference=haod}>
        at __randomizedtesting.SeedInfo.seed([6441E51410EE961B:FE48ED1D9D674ADC]:0)
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.elasticsearch.client.RequestConvertersTests.doTestGetSource(RequestConvertersTests.java:256)
        at org.elasticsearch.client.RequestConvertersTests.testGetSource(RequestConvertersTests.java:176)

REPRODUCE WITH: ./gradlew ':client:rest-high-level:test' --tests "org.elasticsearch.client.RequestConvertersTests.testMultiGet" -Dtests.seed=6441E51410EE961B -Dtests.security.manager=true -Dtests.locale=es-US -Dtests.timezone=SystemV/MST7 -Druntime.java=15

org.elasticsearch.client.RequestConvertersTests > testMultiGet FAILED
    java.lang.AssertionError: expected:<{refresh=true}> but was:<{}>
        at __randomizedtesting.SeedInfo.seed([6441E51410EE961B:538FF24A8A03B08C]:0)
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.elasticsearch.client.RequestConvertersTests.testMultiGet(RequestConvertersTests.java:305)

REPRODUCE WITH: ./gradlew ':client:rest-high-level:test' --tests "org.elasticsearch.client.RequestConvertersTests.testSourceExists" -Dtests.seed=6441E51410EE961B -Dtests.security.manager=true -Dtests.locale=es-US -Dtests.timezone=SystemV/MST7 -Druntime.java=15

org.elasticsearch.client.RequestConvertersTests > testSourceExists FAILED
    java.lang.AssertionError: expected:<{routing=OlPIq, refresh=true}> but was:<{routing=OlPIq}>
        at __randomizedtesting.SeedInfo.seed([6441E51410EE961B:A1A97D003C3A0640]:0)
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:834)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.elasticsearch.client.RequestConvertersTests.doTestSourceExists(RequestConvertersTests.java:218)
        at org.elasticsearch.client.RequestConvertersTests.testSourceExists(RequestConvertersTests.java:167)

Description of changes:

  • Remove the tests of validating refresh parameter in getSourceRequest and multiGetRequest

The PR aims to fix the unit tests in class RequestConvertersTests

The failure is due to the removal of x-pack security (PR #16), where "refresh" parameter is removed from several kinds of requests, such as getRequest, getSourceRequest and multiGetRequest (commit)

Testing:

$ ./gradlew ':client:rest-high-level:test' --tests "org.elasticsearch.client.RequestConvertersTests"
=======================================
Elasticsearch Build Hamster says Hello!
  Gradle Version        : 6.6.1
  OS Info               : Mac OS X 10.16 (x86_64)
  JDK Version           : 14 (AdoptOpenJDK)
  JAVA_HOME             : /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home
  Random Testing Seed   : ED42825F8526BABC
  In FIPS 140 mode      : false
=======================================

> Task :client:rest-high-level:compileTestJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

BUILD SUCCESSFUL in 7s
50 actionable tasks: 2 executed, 48 up-to-date

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@tlfeng tlfeng added >FORK Related to the fork process >test-failure Test failure from CI, local build, etc. labels Feb 4, 2021
@tlfeng tlfeng marked this pull request as ready for review February 4, 2021 05:14
@@ -271,12 +257,6 @@ public void testMultiGet() throws IOException {
expectedParams.put("realtime", "false");
}
}
if (randomBoolean()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a not a good approach to fix the test, we'd better hold this PR on.

@tlfeng
Copy link
Collaborator Author

tlfeng commented Feb 7, 2021

The same test failure is resolved by PR #54, so close this PR.

@tlfeng tlfeng closed this Feb 7, 2021
@tlfeng tlfeng deleted the fix-requestconverterstests branch February 8, 2021 21:12
ritty27 pushed a commit to ritty27/OpenSearch that referenced this pull request May 12, 2024
…ct#42)

Co-authored-by: Mital Awachat <awachatm@amazon.com>

Signed-off-by: Mital Awachat <mitalawachat@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>FORK Related to the fork process >test-failure Test failure from CI, local build, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants