weixin_39927799 2020-11-30 08:56
浏览 0

Testbench wait for vaadin even performed after read only calls

Originally by CodingFabian

I am currently investigating slow performance of vaadin testbench tests. I notice that testbench performs the wait for vaadin call even after read only operations.


12:49:04.798 INFO - Executing: [find element: By.id: input_passwort] at URL: /session/3f8fc825-c897-4908-934c-706c481cf603/element)
12:49:04.813 INFO - Done: /session/3f8fc825-c897-4908-934c-706c481cf603/element
12:49:04.818 INFO - Executing: [execute script: if (window.vaadin =# null) {  return true;}var clientswindow.vaadin.clients;if (clients) {  for (var client in clients) {    if (clients[client].isActive()) {      return false;    }  }  return true;} else {  return false;}, []] at URL: /session/3f8fc825-c897-4908-934c-706c481cf603/execute)
12:49:04.822 INFO - Done: /session/3f8fc825-c897-4908-934c-706c481cf603/execute

This slows the test down, especially when the node running the test is not on localhost, as http roundtrip comes into play. But also without, it is a waste of cpu time to check for vaadin after read only commands.

Imported from https://dev.vaadin.com/ issue #12278

该提问来源于开源项目:vaadin/framework

  • 写回答

5条回答 默认 最新

  • weixin_39927799 2020-11-30 08:56
    关注

    Originally by CodingFabian

    while i think "findElement" for example should be readonly as default, it might be sufficient to open up configuring the "non waited methods"

    
        private static final List<string> methodsNotNeedingWaitForVaadin = Arrays
                .asList("close", "get", "getRemoteControlName", "getWrappedDriver",
                        "manage", "navigate", "quit", "setTestName", "switchTo",
                        "waitForVaadin", "enableWaitForVaadin",
                        "disableWaitForVaadin");
    
        private boolean shouldWaitForVaadin(String methodName) {
            return !methodsNotNeedingWaitForVaadin.contains(methodName);
        }
    </string>
    评论

报告相同问题?