Skip to content

FLUME-3207:Fix some typos in TestReliableSpoolingFileEventReader #193

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

Open
wants to merge 13 commits into
base: trunk
Choose a base branch
from

Conversation

tcsdn
Copy link

@tcsdn tcsdn commented Dec 27, 2017

There is a mistake in testConsumeFileOldestWithLexicographicalComparision

public void testConsumeFileOldestWithLexicographicalComparision()
      throws IOException, InterruptedException {
    ReliableEventReader reader =
        new ReliableSpoolingFileEventReader.Builder().spoolDirectory(WORK_DIR)
                                                     .consumeOrder(ConsumeOrder.OLDEST)
                                                     .build();
    File file1 = new File(WORK_DIR, "new-file1");
    File file2 = new File(WORK_DIR, "new-file2");
    File file3 = new File(WORK_DIR, "new-file3");
    Thread.sleep(1000L);
    FileUtils.write(file3, "New file3 created.\n");
    FileUtils.write(file2, "New file2 created.\n");
    FileUtils.write(file1, "New file1 created.\n");
    file1.setLastModified(file3.lastModified());
    file1.setLastModified(file2.lastModified());
    // file ages are same now they need to be ordered
    // lexicographically (file1, file2, file3).
    List<String> actual = Lists.newLinkedList();
    readEventsForFilesInDir(WORK_DIR, reader, actual);
    List<String> expected = Lists.newLinkedList();
    createExpectedFromFilesInSetup(expected);
    expected.add(""); // Empty file was added in the last in setup.
    expected.add("New file1 created.");
    expected.add("New file2 created.");
    expected.add("New file3 created.");
    Assert.assertEquals(expected, actual);
  }

The code is incorrect. To set the same modify time for the three files, code should be:

file2.setLastModified(file1.lastModified());
file3.setLastModified(file1.lastModified());

Test testConsumeFileYoungestWithLexicographicalComparision has the same mistake.

rgoers and others added 13 commits November 2, 2017 23:01
KafkaChannelTest had quite a few test methods so during the build sometimes it caused a timeout. Refactoring it to smaller test classes decrease the chance of timeouts.

This closes apache#183

Reviewers: Miklos Csanady, Ferenc Szabo

(Viktor Somogyi via Ferenc Szabo)
Set surefire version to the latest and configure it
to rerun failed tests.
This way the flaky tests will not break the build as often.

This closes apache#182

Reviewers: Ferenc Szabo

(Miklos Csanady via Ferenc Szabo)
Current derby version contains security vulnerabilities.
This update will upgrade to a later version.

This closes apache#184

Reviewers: Ferenc Szabo

(Miklos Csanady via Ferenc Szabo)
…ctly

This closes apache#188

Reviewers: Tristan Stevens, Miklos Csanady

(Ferenc Szabo via Denes Arvay)
This change upgrades the netty library to 3.10.6 and also adds netty-all 4.1.17

This closes apache#155

Reviewers: Miklos Csanady

(Ferenc Szabo via Denes Arvay)
@tcsdn
Copy link
Author

tcsdn commented Dec 27, 2017

@bessbd Can you please review this small patch?

Copy link
Contributor

@mcsanady mcsanady left a comment

Choose a reason for hiding this comment

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

Thank you for this finding. This is definitely a bug.

@asfgit
Copy link

asfgit commented Aug 17, 2018

Can one of the admins verify this patch?

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.

5 participants