Skip to content

Test failure: opentest4j.AssertionFailedError #203

@digitzh

Description

@digitzh

I followed README.md to install CloudSim on WSL2, and a test fails when I ran mvn clean package:

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   CloudSimExampleTest.runCloudSimExample9:145 expected: <1000.0> but was: <1000.018>
[INFO]
[ERROR] Tests run: 13, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for cloudsim-package 7.0.0-alpha:
[INFO]
[INFO] cloudsim-package ................................... SUCCESS [  0.103 s]
[INFO] cloudsim ........................................... SUCCESS [  4.740 s]
[INFO] cloudsim-examples .................................. FAILURE [  7.584 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12.492 s
[INFO] Finished at: 2025-03-15T10:22:45+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.2.5:test (default-test) on project cloudsim-examples: There are test failures.
[ERROR] Please refer to /home/user/cloudsim/modules/cloudsim-examples/target/surefire-reports for the individual test results.

Log file in modules/cloudsim-examples/target/surefire-reports/org.cloudbus.cloudsim.examples.CloudSimExampleTest.txt shows:

...
-------------------------------------------------------------------------------
Test set: org.cloudbus.cloudsim.examples.CloudSimExampleTest
-------------------------------------------------------------------------------
Tests run: 9, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 6.169 s <<< FAILURE! -- in org.cloudbus.cloudsim.examples.CloudSimExampleTest
org.cloudbus.cloudsim.examples.CloudSimExampleTest.runCloudSimExample9 -- Time elapsed: 0.007 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <1000.0> but was: <1000.018>
        at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
        at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:86)
        at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:81)
        at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1014)
        at org.cloudbus.cloudsim.examples.CloudSimExampleTest.runCloudSimExample9(CloudSimExampleTest.java:145)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions