Skip to content

[improve][test] force initialize field to avoid polluted by mocks - #17022

Merged
hezhangjian merged 6 commits into
apache:masterfrom
tisonkun:avoid-modify-static-final
Aug 22, 2022
Merged

hezhangjian merged 6 commits into
apache:masterfrom
tisonkun:avoid-modify-static-final

Conversation

@tisonkun

@tisonkun tisonkun commented Aug 9, 2022

Copy link
Copy Markdown
Member

Master Issue: #16912

  • doc-not-needed

cc @shoothzj @eolivelli @nicoloboschi @Technoboy-

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Aug 9, 2022
@tisonkun

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

1 similar comment
@tisonkun

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

@tisonkun

Copy link
Copy Markdown
Member Author

It seems CI failed only on known flaky test #17011.

@lhotari

lhotari commented Aug 10, 2022

Copy link
Copy Markdown
Member

@tisonkun Have you checked with a debugger or logging that the tests actually do what they are claiming to do? (for example recover after OOME)

I'm not a great fan of these tests and I'm fine with removing them. However my concern is that after the changes, they won't be really testing anything and no OOME is thrown ever.

@tisonkun

Copy link
Copy Markdown
Member Author

@lhotari

For PulsarByteBufAllocatorDefaultTest and PulsarByteBufAllocatorOomThrowExceptionTest, they assert the config and it's well verified.

For BatchMessageContainerImplTest, you're right that OOME isn't tested anymore. I'll try to investigate a bit.

@tisonkun
tisonkun force-pushed the avoid-modify-static-final branch from b97c5d2 to cbda29f Compare August 10, 2022 10:24
@tisonkun

tisonkun commented Aug 10, 2022 •

Copy link
Copy Markdown
Member Author

Fixed in cbda29f.

Perhaps we can consider something like failpoint for Golang to noninvasive inject failure. I don't know whether the JVM ecosystem already has a such library, though.

UPDATE: I verify the behavior is the same before and after this patch now. However, batchMessageContainer cannot self-healing. Even on master, it continues throws while in add it catches the exception.

@tisonkun

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

@tisonkun

Copy link
Copy Markdown
Member Author

ping @shoothzj @lhotari

@tisonkun

Copy link
Copy Markdown
Member Author

ping @lhotari @codelipenghui @shoothzj

@tisonkun

Copy link
Copy Markdown
Member Author

@shoothzj @nicoloboschi could you help with merging this patch?

@hezhangjian
hezhangjian merged commit 7747795 into apache:master Aug 22, 2022
@tisonkun
tisonkun deleted the avoid-modify-static-final branch August 22, 2022 12:15
@Technoboy- Technoboy- modified the milestones: 2.12.0, 2.11.0 Sep 13, 2022
Technoboy- pushed a commit that referenced this pull request Sep 13, 2022
liangyepianzhou pushed a commit that referenced this pull request Dec 14, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
…ache#17022)

Master Issue: apache#16912

- [x] `doc-not-needed`

cc @shoothzj @eolivelli @nicoloboschi @Technoboy-

Signed-off-by: tison <[email protected]>
(cherry picked from commit 7747795)
(cherry picked from commit 35097fd)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
…ache#17022)

Master Issue: apache#16912

- [x] `doc-not-needed`

cc @shoothzj @eolivelli @nicoloboschi @Technoboy-

Signed-off-by: tison <[email protected]>
(cherry picked from commit 7747795)
(cherry picked from commit 35097fd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants