Skip to content

FLUME-3207:Fix some typos in TestReliableSpoolingFileEventReader - #193

Open
tcsdn wants to merge 13 commits into
apache:trunkfrom
tcsdn:flume-3207
Open

FLUME-3207:Fix some typos in TestReliableSpoolingFileEventReader#193
tcsdn wants to merge 13 commits into
apache:trunkfrom
tcsdn:flume-3207

Conversation

@tcsdn

@tcsdn tcsdn commented Dec 27, 2017

Copy link
Copy Markdown

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

tcsdn commented Dec 27, 2017

Copy link
Copy Markdown
Author

@bessbd Can you please review this small patch?

@mcsanady mcsanady left a comment

Copy link
Copy Markdown
Contributor

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

asfgit commented Aug 17, 2018

Copy link
Copy Markdown

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.

4 participants