Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-21052

Non-Idempotent-Outcome flaky test in AddDataSourceOperationsUnitTestCase

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Optional Optional
    • None
    • None
    • Test Suite
    • None
    • Hide

      Copy the existing test file

      testsuite/integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/datasource/AddDataSourceOperationsUnitTestCase.java
      

      to

      testsuite/integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/datasource/AddDataSourceOperationsUnitTestCase2.java
      

      In the copied file, rename the test class to:

      public class AddDataSourceOperationsUnitTestCase2 \{ ... }
      

      Run both test classes sequentially in a single Maven invocation:

      mvn test \
        -Dtest=org.jboss.as.test.smoke.mgmt.datasource.AddDataSourceOperationsUnitTestCase#testAddDsAndTestConnection,org.jboss.as.test.smoke.mgmt.datasource.AddDataSourceOperationsUnitTestCase2#testAddDsAndTestConnection \
        -pl testsuite/integration/smoke
      

      Observe that the first test class (AddDataSourceOperationsUnitTestCase2) passes, while the second one (AddDataSourceOperationsUnitTestCase) fails with a deployment error:

      AddDataSourceOperationsUnitTestCase » Deployment Cannot deploy test-jdbc.jar: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => "WFLYCTL0212: Duplicate resource [(\"deployment\" => \"test-jdbc.jar\")]"}}
      
      Show
      Copy the existing test file testsuite/integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/datasource/AddDataSourceOperationsUnitTestCase.java to testsuite/integration/smoke/src/test/java/org/jboss/as/test/smoke/mgmt/datasource/AddDataSourceOperationsUnitTestCase2.java In the copied file, rename the test class to: public class AddDataSourceOperationsUnitTestCase2 \{ ... } Run both test classes sequentially in a single Maven invocation: mvn test \ -Dtest=org.jboss.as.test.smoke.mgmt.datasource.AddDataSourceOperationsUnitTestCase#testAddDsAndTestConnection,org.jboss.as.test.smoke.mgmt.datasource.AddDataSourceOperationsUnitTestCase2#testAddDsAndTestConnection \ -pl testsuite/integration/smoke Observe that the first test class (AddDataSourceOperationsUnitTestCase2) passes, while the second one (AddDataSourceOperationsUnitTestCase) fails with a deployment error: AddDataSourceOperationsUnitTestCase » Deployment Cannot deploy test-jdbc.jar: { "WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => { "Operation step-1" => "WFLYCTL0212: Duplicate resource [(\" deployment\ " => \" test-jdbc.jar\ ")]" }}
    • ---
    • ---

      Order-dependent test isolation issue in AddDataSourceOperationsUnitTestCase#testAddDsAndTestConnection: duplicate deployment test-jdbc.jar remains deployed across test classes and causes WFLYCTL0212: Duplicate resource on the second run.

              Unassigned Unassigned
              bee0511 JIAN-FONG YU
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: