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

Fix flaky MultipartEncoderTckTest.required_spec101... #5136

Merged
merged 3 commits into from
Aug 23, 2023

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Aug 22, 2023

Motivation:

MultipartEncoderTckTest.required_spec101_XXX fails quite often.
https://ge.armeria.dev/scans/tests?search.timeZoneId=Asia/Seoul&tests.container=com.linecorp.armeria.common.multipart.MultipartEncoderTckTest&tests.test=required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements

java.lang.AssertionError: Publisher com.linecorp.armeria.common.multipart.MultipartEncoder@3eec8583 produced no element after first `request` within 200 ms
at org.testng.Assert.fail(Assert.java:98)
at org.reactivestreams.tck.TestEnvironment.flopAndFail(TestEnvironment.java:285)
at org.reactivestreams.tck.TestEnvironment$Receptacle.next(TestEnvironment.java:1047)
at org.reactivestreams.tck.TestEnvironment$ManualSubscriber.nextElement(TestEnvironment.java:514)
at org.reactivestreams.tck.TestEnvironment$ManualSubscriber.nextElement(TestEnvironment.java:510)
at org.reactivestreams.tck.PublisherVerification$3.run(PublisherVerification.java:212)
at org.reactivestreams.tck.PublisherVerification.activePublisherTest(PublisherVerification.java:1135)
at
org.reactivestreams.tck.PublisherVerification.required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements(PublisherVerification.java:204)

The failure couldn't be reproduced locally. I checked the log on the Gradle scan and it shows that the classes are initialized when the test starts.

I guess JVM lazy class initialization and the Netty worker group initialization could affect the failure.

Modifications:

  • Early initialize Netty worker group before starting the tests
  • Increase timeout

Result:

Motivation:

`MultipartEncoderTckTest.required_spec101_XXX` fails quite often.
https://ge.armeria.dev/scans/tests?search.timeZoneId=Asia/Seoul&tests.container=com.linecorp.armeria.common.multipart.MultipartEncoderTckTest&tests.test=required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements
```java
java.lang.AssertionError: Publisher com.linecorp.armeria.common.multipart.MultipartEncoder@3eec8583 produced no element after first `request` within 200 ms
at org.testng.Assert.fail(Assert.java:98)
at org.reactivestreams.tck.TestEnvironment.flopAndFail(TestEnvironment.java:285)
at org.reactivestreams.tck.TestEnvironment$Receptacle.next(TestEnvironment.java:1047)
at org.reactivestreams.tck.TestEnvironment$ManualSubscriber.nextElement(TestEnvironment.java:514)
at org.reactivestreams.tck.TestEnvironment$ManualSubscriber.nextElement(TestEnvironment.java:510)
at org.reactivestreams.tck.PublisherVerification$3.run(PublisherVerification.java:212)
at org.reactivestreams.tck.PublisherVerification.activePublisherTest(PublisherVerification.java:1135)
at
org.reactivestreams.tck.PublisherVerification.required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements(PublisherVerification.java:204)
```

The failure couldn't be reproduced locally.  I checked the log on the
Gradle scan and it shows that the classes are initialized when the test
starts.

I guess JVM initalization and the Netty worker group intialization could
affect the failure.

Modifications:

- Early initialze Netty worker group before starting the tests
- Increase timeout

Result:

- Closes line#4554
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.02% ⚠️

Comparison is base (12df7bd) 74.23% compared to head (45acd7b) 74.22%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5136      +/-   ##
============================================
- Coverage     74.23%   74.22%   -0.02%     
+ Complexity    19811    19807       -4     
============================================
  Files          1698     1698              
  Lines         73093    73093              
  Branches       9359     9359              
============================================
- Hits          54264    54256       -8     
- Misses        14395    14404       +9     
+ Partials       4434     4433       -1     

see 17 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@jrhee17 jrhee17 left a comment

Choose a reason for hiding this comment

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

Happy with the changes if the CI passes 👍 👍 👍

Copy link
Member

@trustin trustin left a comment

Choose a reason for hiding this comment

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

👍

@trustin trustin added this to the 1.25.1 milestone Aug 23, 2023
Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

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

Thanks!

@jrhee17 jrhee17 merged commit 59baf81 into line:main Aug 23, 2023
jrhee17 added a commit to jrhee17/armeria that referenced this pull request Aug 24, 2023
* Update snapshot version to 1.25.1 (line#5137)

* Include logback12 from logback module (line#5139)

Motivation:

@ikhoon pointed out that the `logback` module doesn't bring in the
`logback12` module in the pom.

Modifications:

- Modified so that the `logback` module correctly declares the
dependency.

Result:

- `logback` module contains the correct dependencies
- Describe the consequences that a user will face after this PR is
merged.

<!--
Visit this URL to learn more about how to write a pull request
description:

https://armeria.dev/community/developer-guide#how-to-write-pull-request-description
-->

* Release note for 1.25.1 (line#5140)

![FireShot Capture 011 - 1 25 1 release notes — Armeria release notes -
localhost](https://github.com/line/armeria/assets/8510579/b480ecaf-4034-453a-be93-58f865cad5b2)

* Fix flaky `MultipartEncoderTckTest.required_spec101...` (line#5136)

Motivation:

`MultipartEncoderTckTest.required_spec101_XXX` fails quite often.

https://ge.armeria.dev/scans/tests?search.timeZoneId=Asia/Seoul&tests.container=com.linecorp.armeria.common.multipart.MultipartEncoderTckTest&tests.test=required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements
```java
java.lang.AssertionError: Publisher com.linecorp.armeria.common.multipart.MultipartEncoder@3eec8583 produced no element after first `request` within 200 ms
at org.testng.Assert.fail(Assert.java:98)
at org.reactivestreams.tck.TestEnvironment.flopAndFail(TestEnvironment.java:285)
at org.reactivestreams.tck.TestEnvironment$Receptacle.next(TestEnvironment.java:1047)
at org.reactivestreams.tck.TestEnvironment$ManualSubscriber.nextElement(TestEnvironment.java:514)
at org.reactivestreams.tck.TestEnvironment$ManualSubscriber.nextElement(TestEnvironment.java:510)
at org.reactivestreams.tck.PublisherVerification$3.run(PublisherVerification.java:212)
at org.reactivestreams.tck.PublisherVerification.activePublisherTest(PublisherVerification.java:1135)
at
org.reactivestreams.tck.PublisherVerification.required_spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements(PublisherVerification.java:204)
```

The failure couldn't be reproduced locally. I checked the log on the
Gradle scan and it shows that the classes are initialized when the test
starts.

I guess JVM lazy class initialization and the Netty worker group
initialization could affect the failure.

Modifications:

- Early initialize Netty worker group before starting the tests
- Increase timeout

Result:

- Closes line#4554

---------

Co-authored-by: Trustin Lee <[email protected]>

* modify run for local repo experiment

---------

Co-authored-by: Ikhun Um <[email protected]>
Co-authored-by: Trustin Lee <[email protected]>
@ikhoon ikhoon deleted the multipart-encoder branch June 28, 2024 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants