Skip to content

test_audit_plugin.TestAuditPlugin.test_audit_plugin occasionally fails #172

@korydraughn

Description

@korydraughn

I believe the occasional failure is timing based.

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="irods.test.test_audit_plugin.TestAuditPlugin-20250515133032" tests="1" file="irods/test/test_audit_plugin.py" time="59.209" timestamp="2025-05-15T13:31:31" failures="1" errors="0" skipped="0">
        <testcase classname="irods.test.test_audit_plugin.TestAuditPlugin" name="test_audit_plugin" time="59.209" timestamp="2025-05-15T13:31:31" file="scripts/irods/test/test_audit_plugin.py" line="46">
                <failure type="AssertionError" message="'failed' != 'passed'
- failed
+ passed
"><![CDATA[Traceback (most recent call last):
  File "/var/lib/irods/scripts/irods/test/test_audit_plugin.py", line 70, in test_audit_plugin
    self.assertEqual(result, 'passed')
AssertionError: 'failed' != 'passed'
- failed
+ passed

]]></failure>

The assertion on L70 is where the test fails.

print("result queue size is ", result_queue.qsize())
self.assertEqual(0, pid_queue.qsize(), "the joinable queue pid_queue should be empty")
self.assertTrue(1 <= result_queue.qsize(), "the result queue size should at least be one")
for i in range(result_queue.qsize()):
result = result_queue.get()
self.assertEqual(result, 'passed')

Notice the comment attached to the assertion on L67. That assertion is communicating that the test only needs a non-empty queue. If that's the intention, then the test should pass as long as one instance of passed exists in the queue. It's possible that the server is shut down before the test can produce a state which leads to success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions