You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Mark Payne (JIRA)" <ji...@apache.org> on 2018/05/16 14:29:00 UTC
[jira] [Created] (NIFI-5202) TestListDatabaseTables timing issue
Mark Payne created NIFI-5202:
--------------------------------
Summary: 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
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)