google / blockly-android

Blockly for Android
Apache License 2.0
673 stars 209 forks source link

Allow individual tests to adjust the timeout #621

Closed AnmAtAnm closed 7 years ago

AnmAtAnm commented 7 years ago

...such as the variable name dialog tests which fail so often (now set to 5x).


This change is Reviewable

RoboErikG commented 7 years ago

One question, then :lgtm_strong:


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion.


blocklytest/src/androidTest/java/com/google/blockly/android/ui/NameVariableDialogTest.java, line 56 at r1 (raw file):

  @Test
  public void dialogShowsOldVariableNameWhenRenaming() throws Exception {
    testTimeoutMs *= 5;  // Allow longer time for dialog interaction test

Does a new instance of this class get instantiated for each test or do you need to set the testTimeoutMs to the default in setUp?


Comments from Reviewable

AnmAtAnm commented 7 years ago

Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


blocklytest/src/androidTest/java/com/google/blockly/android/ui/NameVariableDialogTest.java, line 56 at r1 (raw file): JUnit test cases are instantiated for each test run, to minimize leftover state, like you're suggesting.

@Test: To run the method, JUnit first constructs a fresh instance of the class then invokes the annotated method.

http://junit.sourceforge.net/javadoc/org/junit/Test.html


Comments from Reviewable