Skip to content

MAPREDUCE-7358. Clean shared state pollution to avoid flaky test testMR#2

Open
LALAYANG wants to merge 1 commit intotrunkfrom
flaky-testMR
Open

MAPREDUCE-7358. Clean shared state pollution to avoid flaky test testMR#2
LALAYANG wants to merge 1 commit intotrunkfrom
flaky-testMR

Conversation

@LALAYANG
Copy link
Owner

@LALAYANG LALAYANG commented Aug 9, 2021

This PR is similar to merged apache#2499, but for a different test.
Link to issue: https://issues.apache.org/jira/browse/MAPREDUCE-7358

What is the purpose of this change

This PR is to fix a non-idempotent test org.apache.hadoop.mapred.TestClusterMRNotification.testMR.

Why the test failed

The root cause for the failure is that this test does not clean NotificationServlet.counter at the end, which pollutes the shared state. It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state polluted by this test.

Reproduce test failure

Run the test twice in the same JVM.

Expected result

The test should run successfully without any failures.

Actual result

Failure from test run:
NotificationTestCase.testMR:174 expected:<2> but was:<8>

Fix

Clear the value of NotificationServlet.counter at the end of the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant