google-cloud-eclipse icon indicating copy to clipboard operation
google-cloud-eclipse copied to clipboard

Flaky ImportNativeAppEngineStandardProjectTest.importAppEngineStandardJava8_from1_3_1

Open chanseokoh opened this issue 7 years ago • 3 comments

com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest
importAppEngineStandardJava7_from1_3_1(com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest)  Time elapsed: 10.968 sec  <<< FAILURE!
java.lang.AssertionError: 
Expected: an array with size a value greater than <0>
     but: array size <0> was equal to <0>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:956)
	at org.junit.Assert.assertThat(Assert.java:923)
	at com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest.updateOldContainers(ImportNativeAppEngineStandardProjectTest.java:134)
	at com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest.importAppEngineStandardJava7_from1_3_1(ImportNativeAppEngineStandardProjectTest.java:77)

importAppEngineStandardJava8_from1_3_1(com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest)  Time elapsed: 9.685 sec
Running com.google.cloud.tools.eclipse.integration.appengine.ImportMavenAppEngineStandardProjectTest

Looking at the assertion code, the root cause may be due to https://github.com/GoogleCloudPlatform/google-cloud-eclipse/pull/3014#issuecomment-379849268.

    // ensure the master-library container has been resolved by checking its contents
    IJavaProject javaProject = JavaCore.create(project);
    IClasspathContainer masterContainer =
        JavaCore.getClasspathContainer(BuildPath.MASTER_CONTAINER_PATH, javaProject);
    assertThat(masterContainer.getClasspathEntries(), arrayWithSize(greaterThan(0)));

chanseokoh avatar Apr 10 '18 17:04 chanseokoh

#3014 is supposed to fix this. Closing.

chanseokoh avatar Apr 29 '18 18:04 chanseokoh

Just seen on the Photon build:

[Watchdog] > importAppEngineStandardJava8_from1_3_1(com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest)
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x800986 (Import )
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
20:39:18.272 [WorkbenchTestable] WARN  o.e.s.s.f.widgets.SWTBotTreeItem - Tree item TreeItem with text {General} is already expanded. Won't expand it again.
20:39:18.358 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Next >' and with style 'SWT.PUSH')
20:39:18.359 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Next >' and with style 'SWT.PUSH')
20:39:18.360 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Next >' and with style 'SWT.PUSH')
20:39:18.360 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Next >' and with style 'SWT.PUSH')
20:39:18.360 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Next >' and with style 'SWT.PUSH')
20:39:18.560 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Finish' and with style 'SWT.PUSH')
20:39:18.562 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Finish' and with style 'SWT.PUSH')
20:39:18.564 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Finish' and with style 'SWT.PUSH')
20:39:18.565 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Finish' and with style 'SWT.PUSH')
20:39:18.565 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'Finish' and with style 'SWT.PUSH')
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x800021 (data - Ecl)
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
20:39:21.146 [WorkbenchTestable] WARN  c.g.c.t.e.a.l.p.LibraryClasspathContainerSerializer - Library-id state file cannot be created, save failed
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x800bb2 (Delete Res)
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
20:39:23.712 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH')
20:39:23.713 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH')
20:39:23.714 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH')
20:39:23.715 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH')
20:39:23.718 [main] WARN  o.e.s.s.finder.widgets.SWTBotButton - Widget is not enabled: (of type 'Button' and with mnemonic 'OK' and with style 'SWT.PUSH')
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x800021 (data - Ecl)
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 44.782 sec <<< FAILURE! - in com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest
importAppEngineStandardJava7_from1_3_1(com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest)  Time elapsed: 31.596 sec
importAppEngineStandardJava8_from1_3_1(com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest)  Time elapsed: 6.541 sec  <<< FAILURE!
java.lang.AssertionError: 
Expected: an array with size a value greater than <0>
     but: array size <0> was equal to <0>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.junit.Assert.assertThat(Assert.java:956)
	at org.junit.Assert.assertThat(Assert.java:923)
	at com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest.updateOldContainers(ImportNativeAppEngineStandardProjectTest.java:134)
	at com.google.cloud.tools.eclipse.integration.appengine.ImportNativeAppEngineStandardProjectTest.importAppEngineStandardJava8_from1_3_1(ImportNativeAppEngineStandardProjectTest.java:105)

briandealwis avatar May 22 '18 20:05 briandealwis

I've seen this recently a few times.

Finally, some potential clue. Found a way to reproduce this. This is very interesting. I don't follow how this can always trigger the issue. Just call getClasspathContainer() once before calling CloudToolsEclipseProjectUpdater.updateProject().

   private void updateOldContainers() throws JavaModelException {
+    IJavaProject javaProject = JavaCore.create(project);
+    JavaCore.getClasspathContainer(BuildPath.MASTER_CONTAINER_PATH, javaProject);
+
     assertTrue(CloudToolsEclipseProjectUpdater.hasOldContainers(project));
     IStatus updateStatus =
         CloudToolsEclipseProjectUpdater.updateProject(project, SubMonitor.convert(null));
     assertTrue("Update failed: " + updateStatus.getMessage(), updateStatus.isOK());
     assertFalse(CloudToolsEclipseProjectUpdater.hasOldContainers(project));
 
     // ensure the master-library container has been resolved by checking its contents
-    IJavaProject javaProject = JavaCore.create(project);
     IClasspathContainer masterContainer =
         JavaCore.getClasspathContainer(BuildPath.MASTER_CONTAINER_PATH, javaProject);
     assertThat(masterContainer.getClasspathEntries(), arrayWithSize(greaterThan(0)));

chanseokoh avatar Jul 03 '18 16:07 chanseokoh