BsoBird commented on code in PR #5891: URL: https://github.com/apache/hive/pull/5891#discussion_r2168023484
########## ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFUUID.java: ########## @@ -23,26 +23,41 @@ import org.apache.hadoop.hive.ql.exec.FunctionRegistry; import org.apache.hadoop.hive.ql.udf.generic.GenericUDFBridge; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; import org.junit.Test; +import java.util.concurrent.TimeUnit; + /** * TestUDFUUID. */ public class TestUDFUUID { @Test public void testUUID() throws Exception { UDFUUID udf = new UDFUUID(); - String id1 = udf.evaluate().toString(); String id2 = udf.evaluate().toString(); - assertFalse(id1.equals(id2)); - assertEquals(id1.length(), 36); assertEquals(id2.length(), 36); - GenericUDFBridge bridge = new GenericUDFBridge("uuid", false, UDFUUID.class.getName()); assertFalse(FunctionRegistry.isDeterministic(bridge)); } + + @Test + public void testUUIDv7() throws Exception { + UDFUUIDv7 udf = new UDFUUIDv7(); + String id1 = udf.evaluate(null).toString(); + TimeUnit.MILLISECONDS.sleep(1); Review Comment: @deniskuzZ @zabetak Sir, I have replaced the test cases and removed Thread.sleep(). However, I still personally believe that some basic test cases should be added. Not adding any tests feels very strange. Based on consistent experience, we can assume that code without test cases simply does not work properly. Therefore, not adding test cases makes me feel very uncomfortable. (Maybe I have OCD.)😝 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org