Skip to content

Conversation

@prashantmital
Copy link
Contributor

@prashantmital prashantmital commented Jul 7, 2021

TO DO:

@prashantmital prashantmital requested a review from ShaneHarvey July 7, 2021 01:54

tasks:

task_groups:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. I haven't since "task_groups" before. I gather it's a way to add arbitrary setup/teardown code to an existing task?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I too, haven't used them before. I picked this right out of the sample in https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/config.yml

elif 'parsed' in self.cmd_line:
params = self.cmd_line['parsed'].get('setParameter', [])
if 'enableTestCommands=1' in params:
self.has_ipv6 = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Serverless doesn't support ipv6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure... It seems we only use this in one test (TestClient.test_ipv6) - do we want to run that test class against serverless?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, I don't think we need to run that test on serverless. A maybe useful test would be to manually resolve the serverless host to ipv6 and then attempt to connect. Up to you. I don't think it's needed. Should be something that's tested on the cloud team's side.

@prashantmital prashantmital marked this pull request as ready for review July 8, 2021 00:38
@ShaneHarvey
Copy link
Member

Looks like there are still a large number of failures:

...
 [2021/07/09 20:16:42.584] FAIL [0.916s]: test_retryable_reads_listIndexes_serverErrors_ListIndexes_succeeds_after_SocketException (test_retryable_reads.TestSpec)
 [2021/07/09 20:16:42.584] ----------------------------------------------------------------------
 [2021/07/09 20:16:42.584] Traceback (most recent call last):
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/__init__.py", line 534, in wrap
 [2021/07/09 20:16:42.584]     return f(*args, **kwargs)
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/__init__.py", line 534, in wrap
 [2021/07/09 20:16:42.584]     return f(*args, **kwargs)
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/test_retryable_reads.py", line 104, in run_scenario
 [2021/07/09 20:16:42.584]     self.run_scenario(scenario_def, test)
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/utils_spec_runner.py", line 557, in run_scenario
 [2021/07/09 20:16:42.584]     self.check_events(test, listener, session_ids)
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/utils_spec_runner.py", line 380, in check_events
 [2021/07/09 20:16:42.584]     len(res['started']), len(test['expectations']), cmds)
 [2021/07/09 20:16:42.584] AssertionError: 1 != 2 : [{'listIndexes': 'coll', 'cursor': {}, 'lsid': {'id': UUID('3045bd69-a342-4e1c-9442-ae30e0764147')}, '$clusterTime': {'clusterTime': Timestamp(1625861782, 4), 'signature': {'hash': b'\xbe[\xde\xe4%\xf8&\xd1\x84\xef_\xc1Y\x1c\xcc\x12\x0c0\xec\xe2', 'keyId': 6982211488521912322}}, '$db': 'retryable-reads-tests', '$readPreference': {'mode': 'primary'}}]
 [2021/07/09 20:16:42.584] ======================================================================
 [2021/07/09 20:16:42.584] FAIL [0.644s]: test_cluster_time_no_server_support (test_session.TestCausalConsistency)
 [2021/07/09 20:16:42.584] ----------------------------------------------------------------------
 [2021/07/09 20:16:42.584] Traceback (most recent call last):
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/__init__.py", line 534, in wrap
 [2021/07/09 20:16:42.584]     return f(*args, **kwargs)
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/test_session.py", line 1057, in test_cluster_time_no_server_support
 [2021/07/09 20:16:42.584]     self.assertIsNone(after_cluster_time)
 [2021/07/09 20:16:42.584] AssertionError: {'clusterTime': Timestamp(1625861787, 5), 'signature': {'hash': b"\xee\n<c\xa3\xce\xb0o\xf7\x18'P\x1c\x1d\x04\xe6\xcd\xb0\x1e\x8f", 'keyId': 6982211488521912322}} is not None
 [2021/07/09 20:16:42.584] ======================================================================
 [2021/07/09 20:16:42.584] FAIL [0.083s]: test_server_not_causal (test_session.TestCausalConsistency)
 [2021/07/09 20:16:42.584] ----------------------------------------------------------------------
 [2021/07/09 20:16:42.584] Traceback (most recent call last):
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/__init__.py", line 534, in wrap
 [2021/07/09 20:16:42.584]     return f(*args, **kwargs)
 [2021/07/09 20:16:42.584]   File "/data/mci/9b6fda5b61ca43196c9b54664e292149/src/test/test_session.py", line 1016, in test_server_not_causal
 [2021/07/09 20:16:42.584]     self.assertIsNone(act)
 [2021/07/09 20:16:42.584] AssertionError: Timestamp(1625861787, 6) is not None
 [2021/07/09 20:16:42.690] ----------------------------------------------------------------------
 [2021/07/09 20:16:42.690] Ran 2042 tests in 426.268s
 [2021/07/09 20:16:42.690] FAILED (failures=198, errors=77, skipped=762)

Waiting for those to be resolved before reviewing again.

@prashantmital prashantmital force-pushed the PYTHON-2545/test-proxy-as-mongos branch from 37d5f0c to cedc355 Compare July 12, 2021 23:48
**self.default_client_options)

# May not have this if OperationFailure was raised earlier.
self.cmd_line = self.client.admin.command('getCmdLineOpts')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does getCmdLineOpts actually work on serverless?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works but doesn't give us any useful info:

self.client.admin.command('getCmdLineOpts')
{'argv': [], 'parsed': {}, 'ok': 1}

# Generate unified tests.
globals().update(generate_test_classes(TEST_PATH, module=__name__))
globals().update(generate_test_classes(
TEST_PATH, module=__name__, RUN_ON_SERVERLESS=True))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't RUN_ON_SERVERLESS be true for all unified tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as per the wording of the spec. It only needs to be enabled for spec tests pertaining to certain driver specifications.

self.skipTest("MongoDB Serverless does not support $out")

if "collation" in test['operation']['arguments']:
self.skipTest("MongoDB Serverless does not support collations")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought they already updated the spec tests themselves. Is this needed anymore? Or did they only update the unified tests and not the v1 ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to make tests serverless friendly were only for unified format.


class TestWriteConcernError(IntegrationTest):
RUN_ON_LOAD_BALANCER = True
RUN_ON_SERVERLESS = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think IgnoreDeprecationsTest also needs RUN_ON_SERVERLESS=True.

@prashantmital prashantmital force-pushed the PYTHON-2545/test-proxy-as-mongos branch from eb61ba8 to 82e3b1d Compare July 26, 2021 23:02
@prashantmital
Copy link
Contributor Author

@ShaneHarvey this is ready for final review.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you ensure the test suite fails in some way if the driver cannot connect to the serverless instance when TEST_SERVERLESS==True? For example you could add an extra test to TestClientContext. Or is this case already covered?

"MongoDB Serverless does not support $out")
if "collation" in operation['arguments']:
self.skipTest(
"MongoDB Serverless does not support collations")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRIVERS-1836 updated the unified tests and DRIVERS-1851 updated the crud v1 tests. Is there any reason why we did not update the retryable reads/writes tests? Can you file a drivers ticket for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is only a concern for Retrayble Reads. I opened DRIVERS-1869.

if 'TEST_SERVERLESS' not in os.environ:
raise SkipTest('TEST_SERVERLESS is not set')

self.assertTrue(client_context.connected,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest client_context.connected and client_context.serverless? Or is that redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat redundant as client_context.serverless is set solely based on the value of TEST_SERVERLESS but it doesn't hurt. Updated.

@prashantmital prashantmital merged commit f07da34 into mongodb:master Jul 27, 2021
@prashantmital prashantmital deleted the PYTHON-2545/test-proxy-as-mongos branch July 27, 2021 23:35
prashantmital added a commit to prashantmital/mongo-python-driver that referenced this pull request Jul 27, 2021
prashantmital added a commit that referenced this pull request Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants