Skip to content

Figure out why test spuriously fails #781

@d-w-moore

Description

@d-w-moore

In this test from 23fb5e2 , in irods/test/data_obj_test.py

    def test_access_time__issue_700(self):
        if self.sess.server_version < (5,):
            self.skipTest("iRODS servers < 5.0.0 do not provide an access_time attribute for data objects.")

        data_path= iRODSPath(self.coll.path,
            unique_name(my_function_name(), datetime.now())
            )
        with self.sess.data_objects.open(data_path,"w") as f:
            f.write(b'_')
        with self.sess.data_objects.open(data_path,"r") as f:
            f.read()

        data = self.sess.data_objects.get(data_path)
        self.assertGreaterEqual(data.access_time, data.modify_time)

The failure is as follows

======================================================================
FAIL [0.142s]: test_access_time__issue_700 (data_obj_test.TestDataObjOps)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/prc.rw/irods/test/data_obj_test.py", line 3317, in test_access_time__issue_700
    self.assertGreaterEqual(data.access_time, data.modify_time)
AssertionError: datetime.datetime(2025, 11, 14, 16, 32, 28, tzinfo=datetime.timezone.utc) not greater than or equal to datetime.datetime(2025, 11, 14, 16, 32, 29, tzinfo=datetime.timezone.utc)

My read of the situation is that the test should never fail under any circumstances. At the worst, the two timestamps should be equal. It's as if the server fails to update the read timestamp under some kind of race condition.

We should investigate.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions