Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test topology-on-consumer: IrodsSession.default_resource always refers to the default resource on the catalog service provider #7721

Open
alanking opened this issue Apr 24, 2024 · 1 comment
Milestone

Comments

@alanking
Copy link
Contributor

Bug Report

iRODS Version, OS and Version

4.3.2

What did you try to do?

Run the following tests in topology on consumer:

  • test_itrim.Test_Itrim.test_itrim_minimum_replicas_to_keep_invalid_values__issue_7502
  • test_itrim.Test_Itrim.test_itrim_option_N_is_deprecated__issue_4860
  • test_itrim.Test_Itrim.test_itrim_option_age_is_deprecated__issue_7498

Expected behavior

The tests should pass because it passes in every other configuration.

Observed behavior (including steps to reproduce, if applicable)

The tests fail with the following message:

<testcase classname="irods.test.test_itrim.Test_Itrim" name="test_itrim_minimum_replicas_to_keep_invalid_values__issue_7502" time="7.525" timestamp="2024-04-24T15:10:12" file="scripts/irods/test/test_itrim.py" line="356">
        <failure type="AssertionError" message="False is not true"><![CDATA[Traceback (most recent call last):
  File "/var/lib/irods/scripts/irods/test/test_itrim.py", line 373, in test_itrim_minimum_replicas_to_keep_invalid_values__issue_7502
    self.assertTrue(lib.replica_exists_on_resource(self.admin, logical_path, self.admin.default_resource))
AssertionError: False is not true
]]></failure>

Al of the failing tests have similar messages, failing on a similar assertion. Here are the lines on the one shown above ( test_itrim.Test_Itrim.test_itrim_minimum_replicas_to_keep_invalid_values__issue_7502):

# Create the data object.
self.admin.assert_icommand(['itouch', logical_path])
# Replicate to two other resources so that we have something to trim, even with the default minimum.
self.admin.assert_icommand(['irepl', '-R', resc1, logical_path])
self.admin.assert_icommand(['irepl', '-R', resc2, logical_path])
self.assertTrue(lib.replica_exists_on_resource(self.admin, logical_path, self.admin.default_resource))
self.assertTrue(lib.replica_exists_on_resource(self.admin, logical_path, resc1))
self.assertTrue(lib.replica_exists_on_resource(self.admin, logical_path, resc2))

Here is the output from the test demonstrating the query which fails:

 --- IrodsSession: icommand executed by [otherrods#tempZone] [itouch /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values] --- 
Assert Command: itouch /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values
Expecting EMPTY: ['']
  stdout:
    | 
  stderr:
    | 
Output found

 --- IrodsSession: icommand executed by [otherrods#tempZone] [irepl -R test_itrim_minimum_replicas_to_keep_invalid_values_resc_1 /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values] --- 
Assert Command: irepl -R test_itrim_minimum_replicas_to_keep_invalid_values_resc_1 /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values
Expecting EMPTY: ['']
  stdout:
    | 
  stderr:
    | 
Output found

 --- IrodsSession: icommand executed by [otherrods#tempZone] [irepl -R test_itrim_minimum_replicas_to_keep_invalid_values_resc_2 /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values] --- 
Assert Command: irepl -R test_itrim_minimum_replicas_to_keep_invalid_values_resc_2 /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values
Expecting EMPTY: ['']
  stdout:
    | 
  stderr:
    | 
Output found

 --- IrodsSession: icommand executed by [otherrods#tempZone] [iquest %s select DATA_ID where COLL_NAME = '/tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3' and DATA_NAME = 'test_itrim_minimum_replicas_to_keep_invalid_values' and DATA_RESC_NAME = 'demoResc'] --- 
 --- IrodsSession: icommand executed by [otherrods#tempZone] [ils -l /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values] --- 
Assert Command: ils -l /tempZone/home/otherrods/2024-04-24Z15:10:05--irods-testing-9btweat3/test_itrim_minimum_replicas_to_keep_invalid_values
Expecting STDOUT: ['test_itrim_minimum_replicas_to_keep_invalid_values']
  stdout:
    |   otherrods         0 2bec7eaeffe6Resource            0 2024-04-24.15:10 & test_itrim_minimum_replicas_to_keep_invalid_values
    |   otherrods         1 test_itrim_minimum_replicas_to_keep_invalid_values_resc_1            0 2024-04-24.15:10 & test_itrim_minimum_replicas_to_keep_invalid_values
    |   otherrods         2 test_itrim_minimum_replicas_to_keep_invalid_values_resc_2            0 2024-04-24.15:10 & test_itrim_minimum_replicas_to_keep_invalid_values
  stderr:
    | 
Output found

The test assumes that the IrodsSession represented by self.admin will have a default_resource value of the local server's storage resource, which in this case is 2bec7eaeffe6Resource. The value queried is demoResc.

We need to update the test tools to get the correct default resource based on the server on which the tests are being run.

@alanking alanking added this to the 4.3.3 milestone Apr 24, 2024
@alanking
Copy link
Contributor Author

Alternatively, the tests can be updated to be more specific about where the source replica is stored on the original itouch command and use that resource for the assertions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant