Skip to content
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

Flaky io.trino.plugin.memory.TestMemoryConnectorTest.testCreateAndDropTable #9051

Closed
phd3 opened this issue Aug 31, 2021 · 4 comments · Fixed by #9055
Closed

Flaky io.trino.plugin.memory.TestMemoryConnectorTest.testCreateAndDropTable #9051

phd3 opened this issue Aug 31, 2021 · 4 comments · Fixed by #9055
Labels

Comments

@phd3
Copy link
Member

phd3 commented Aug 31, 2021

2021-08-30T16:11:41.0365211Z [ERROR] testCreateAndDropTable(io.trino.plugin.memory.TestMemoryConnectorTest)  Time elapsed: 0.007 s  <<< FAILURE!
2021-08-30T16:11:41.0370318Z java.lang.AssertionError: expected [7] but found [8]
2021-08-30T16:11:41.0374137Z 	at org.testng.Assert.fail(Assert.java:94)
2021-08-30T16:11:41.0399162Z 	at org.testng.Assert.failNotEquals(Assert.java:513)
2021-08-30T16:11:41.0404045Z 	at org.testng.Assert.assertEqualsImpl(Assert.java:135)
2021-08-30T16:11:41.0408727Z 	at org.testng.Assert.assertEquals(Assert.java:116)
2021-08-30T16:11:41.0413206Z 	at org.testng.Assert.assertEquals(Assert.java:389)
2021-08-30T16:11:41.0417648Z 	at org.testng.Assert.assertEquals(Assert.java:399)
2021-08-30T16:11:41.0426071Z 	at io.trino.plugin.memory.TestMemoryConnectorTest.testCreateAndDropTable(TestMemoryConnectorTest.java:125)
2021-08-30T16:11:41.0433699Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-08-30T16:11:41.0441950Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-08-30T16:11:41.0451108Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-08-30T16:11:41.0457123Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2021-08-30T16:11:41.0528685Z 	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
2021-08-30T16:11:41.0534737Z 	at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
2021-08-30T16:11:41.0540527Z 	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
2021-08-30T16:11:41.0546447Z 	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
2021-08-30T16:11:41.0553561Z 	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
2021-08-30T16:11:41.0559901Z 	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
2021-08-30T16:11:41.0567549Z 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2021-08-30T16:11:41.0626071Z 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2021-08-30T16:11:41.0628481Z 	at java.base/java.lang.Thread.run(Thread.java:829)

https://github.com/trinodb/trino/runs/3463395818?check_suite_focus=true

@ebyhr
Copy link
Member

ebyhr commented Aug 31, 2021

It seems the test verifies table count before and after the operation. It will fail if other tests create or drop a table at the same time.

    @Test
    public void testCreateAndDropTable()
    {
        int tablesBeforeCreate = listMemoryTables().size();
        assertUpdate("CREATE TABLE test AS SELECT * FROM tpch.tiny.nation", "SELECT count(*) FROM nation");
        assertEquals(listMemoryTables().size(), tablesBeforeCreate + 1);

        assertUpdate("DROP TABLE test");
        assertEquals(listMemoryTables().size(), tablesBeforeCreate);
    }

@ebyhr ebyhr added the test label Aug 31, 2021
@hashhar
Copy link
Member

hashhar commented Aug 31, 2021

@ebyhr Looks like it should be easy to rewrite to use SHOW TABLES to verify table existence to avoid this problem?

Are you already working on this? If not, I'll send a PR.

@ebyhr
Copy link
Member

ebyhr commented Aug 31, 2021

@hashhar I'm not working on this. Please feel free to send PR. Thanks.

@findepi
Copy link
Member

findepi commented Aug 31, 2021

Thanks @hashhar for fixing this!

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

Successfully merging a pull request may close this issue.

4 participants