You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Matt Burgess (JIRA)" <ji...@apache.org> on 2018/05/16 17:11:00 UTC
[jira] [Commented] (NIFI-5202) TestListDatabaseTables timing issue
[ https://issues.apache.org/jira/browse/NIFI-5202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477746#comment-16477746 ]
Matt Burgess commented on NIFI-5202:
------------------------------------
Yeah if the two runs take more than 200 ms then it will refresh on its own, I'll add something to the test that determines the elapsed time and expect 1 or 2 accordingly?
> TestListDatabaseTables timing issue
> -----------------------------------
>
> Key: NIFI-5202
> URL: https://issues.apache.org/jira/browse/NIFI-5202
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Mark Payne
> Priority: Major
>
> I sometimes see TestListDatabaseTables fail in Travis-CI:
> {code:java}
> [INFO] Results:
> [INFO]
> [ERROR] Failures:
> [ERROR] TestListDatabaseTables.testListTablesMultipleRefresh:218 expected:<1> but was:<2>
> [INFO] {code}
> It appears to be a timing issue. When I run it on my laptop, it always succeeds, as-is. However, I can easily reproduce the error above if I update the unit test by adding a Thread.sleep at line 214:
> {code:java}
> assertEquals("2", results.get(0).getAttribute(ListDatabaseTables.DB_TABLE_COUNT));
> runner.clearTransferState();
> Thread.sleep(500);
> // Add another table immediately, the first table should not be listed again but the second should
> stmt.execute("create table TEST_TABLE2 (id integer not null, val1 integer, val2 integer, constraint my_pk2 primary key (id))");
> stmt.close();{code}
> With that Thread.sleep(500) added in, it always fails on my laptop. This essentially is mimicking a slower environment, such as travis-ci.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)