[SRU] testng fails due to missing guava dependency

Bug #1785896 reported by Tiago Stürmer Daitx
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testng (Debian)
Fix Released
Unknown
testng (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
testng 6.9.12-2 code imports a java class from guava but does not declare a dependency on dependency on libguava-java. The actual import is not required and was reported upstream [1] and already fixed [2].

The patch [2] should be applied to testng to prevent failures when running it (see output example at the bottom).

The testsuites from openjdk 10 (and later) added a dependency to testng which then triggered the missing class exception - please note that openjdk-lts in bionic currently does not run any tests, which is why this has not been (yet) fixed.

openjdk-11 is being backported to bionic (see bug #1814133) and has tests enable, thus requiring this fix.

[Test Case]
Execute openjdk-lts autopkgtests from Cosmic using testng 6.9.12-2 and verify that the tests fail because of missing dependency on guava.

After the patch is applied the tests should work fine.

In a bionic schroot:
$ sudo apt build-dep openjdk-lts
$ sudo apt source openjdk-lts
$ cd openjdk-lts-10.0.2+13/test
$ jtreg -v jdk/sun/misc/

- Fail case jtreg output -
(snipped)
runner starting test: sun/misc/InvokeCleaner.java
runner finished test: sun/misc/InvokeCleaner.java
Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 2
runner starting test: sun/misc/SunMiscSignalTest.java
runner finished test: sun/misc/SunMiscSignalTest.java
Failed. Execution failed: `main' threw exception: java.lang.Exception: failures: 3
Test results: passed: 9; failed: 2

- Success case jtreg output -
(snipped)
runner starting test: sun/misc/InvokeCleaner.java
runner finished test: sun/misc/InvokeCleaner.java
Passed. Execution successful
runner starting test: sun/misc/SunMiscSignalTest.java
runner finished test: sun/misc/SunMiscSignalTest.java
Passed. Execution successful
Test results: passed: 11

In the fail case one can also check the failure cause:
$ cat JTwork/sun/misc/InvokeCleaner.jtr
(snipped)
----------System.out:(85/5504)----------
[TestNG] Running:
  sun/misc/InvokeCleaner.java

config InvokeCleaner.init(): success
test InvokeCleaner.badBuffers(): skip
java.lang.NoClassDefFoundError: com/google/common/primitives/Ints
 at org.testng.internal.annotations.JDK15TagFactory.createDataProviderTag(JDK15TagFactory.java:335)
(snipped)

[Regression Potential]

This change only backports a patch that actually removes a non-declare and unnecessary dependency from testng, no regressions are expected at all.

[Original Description]
While running OpenJDK 10 tests I noticed that quite a few tests that depend on testng fail due to a missing guava class.

The package libguava-java has the class but it is not declared as a dependency.

The bug has been reported upstream back in 2016 [1] and fixed a few days after that [2]. The guava class import with a new internal class [3].

testng should be updated to a newer version or that particular patch [3] should be applied to the existing package in both cosmic and bionic.

References:
[1] https://github.com/cbeust/testng/issues/1085
[2] https://github.com/cbeust/testng/pull/1086
[3] https://github.com/cbeust/testng/pull/1086/commits/deeb5847282ae3b5b185c046a8146814bf98b124

Error output example:

java.lang.NoClassDefFoundError: com/google/common/primitives/Ints
 at org.testng.internal.annotations.JDK15TagFactory.createDataProviderTag(JDK15TagFactory.java:335)
 at org.testng.internal.annotations.JDK15TagFactory.createTag(JDK15TagFactory.java:59)
 at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:217)
 at org.testng.internal.annotations.JDK15AnnotationFinder.findAnnotation(JDK15AnnotationFinder.java:111)
 at org.testng.internal.Parameters.findDataProvider(Parameters.java:326)
 at org.testng.internal.Parameters.findDataProvider(Parameters.java:261)
 at org.testng.internal.Parameters.handleParameters(Parameters.java:418)
 at org.testng.internal.Invoker.handleParameters(Invoker.java:1240)
 at org.testng.internal.Invoker.createParameters(Invoker.java:980)
 at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1070)
 at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package testng - 6.9.12-4

---------------
testng (6.9.12-4) unstable; urgency=medium

  * Team upload.

  [ Tiago Stürmer Daitx ]
  * d/p/remove-guava-dependency-pr1086.patch: apply upstream patch to
    remove guava dependency (Closes: #905675, LP: #1785896)

 -- tony mancill <email address hidden> Wed, 08 Aug 2018 06:24:23 -0700

Changed in testng (Ubuntu):
status: New → Fix Released
Changed in testng (Debian):
status: Unknown → Fix Released
tags: added: bionic cosmic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Tiago, or anyone else affected,

Accepted testng into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/testng/6.9.12-2ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in testng (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
description: updated
Revision history for this message
Tiago Stürmer Daitx (tdaitx) wrote :

Following the testcase I verified that:
- jtreg 6.9.12-2 fails
- jtreg 6.9.12-2ubuntu1 works

[More information]
$ apt policy testng
testng:
  Installed: 6.9.12-2
  Candidate: 6.9.12-2ubuntu1
  Version table:
     6.9.12-2ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic-proposed/universe amd64 Packages
 *** 6.9.12-2 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

description: updated
tags: added: verification-done-bionic
removed: bionic cosmic verification-needed verification-needed-bionic
summary: - testng fails due to missing guava dependency
+ [SRU] testng fails due to missing guava dependency
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package testng - 6.9.12-2ubuntu1

---------------
testng (6.9.12-2ubuntu1) bionic; urgency=medium

  * Backport patch from disco to fix OpenJDK 11 FTBFS in Bionic. (LP: #1814133)
    - d/p/remove-guava-dependency-pr1086.patch: apply upstream patch to
      remove guava dependency (Closes: #905675, LP: #1785896)

 -- Tiago Stürmer Daitx <email address hidden> Thu, 31 Jan 2019 19:13:18 +0000

Changed in testng (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.