-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Some tests in test/cql-pytest/test_permissions.py fail on Cassandra #15969
Comments
Unfortunately, fixing the above errors reveals the next two errors:
|
We shouldn't have cql-pytest tests that report failure when run on Cassandra (with test/cql-pytest/run-cassandra): A test that passes on Scylla but fails on Cassandra indicates a *difference* between Scylla's behavior and Cassandra's, and this difference should always be investigated: 1. It can be a Scylla bug, which of should be fixed immediately or reported as a bug and the test changed to fail on Scylla ("xfail"). 2. It can be a minor difference in Scylla's and Cassandra's behavior where both can be accepted. In this case the test should me modified to accept both behaviors, and a comment added to explain why we decided to do that. 3. It can be a Cassandra bug which causes a correct test to fail. This case should not be taken lightly, and a serious effort is needed to be convinced that this is really a Cassandra bug and not our misunderstanding of what Cassandra does. In this case the test should be marked "cassandra_bug" and a detailed comment should explain why. 4. Or it can be an outright bug in the test that caused it to fail on Cassandra. This test had most of these cases :-) There was a test bug in one place (in a Cassandra-specific Java UDF), a minor and (aruably) acceptable difference between the error codes returned by Scylla and Cassandra in one case, and two minor Cassandra bugs (in the error path). All of these are fixed here, and after this patch test/cql-pytest/run-cassandra no longer fails on this file. Fixes scylladb#15969 Signed-off-by: Nadav Har'El <nyh@scylladb.com>
I sent a pull request to fix this. No backports will be needed - the fixes are only relevant when running the tests against Cassandra, something we don't do in CI, and don't do on old branches. |
I think we do test against Cassandra with our Python driver test matrix (still doesn't mean we'll need backports though? unsure). |
Thisissue is about a scylla.git test (in test/cql-pytest), not a Python-driver test. |
We shouldn't have cql-pytest tests that report failure when run on Cassandra (with test/cql-pytest/run-cassandra): A test that passes on Scylla but fails on Cassandra indicates a *difference* between Scylla's behavior and Cassandra's, and this difference should always be investigated: 1. It can be a Scylla bug, which of should be fixed immediately or reported as a bug and the test changed to fail on Scylla ("xfail"). 2. It can be a minor difference in Scylla's and Cassandra's behavior where both can be accepted. In this case the test should me modified to accept both behaviors, and a comment added to explain why we decided to do that. 3. It can be a Cassandra bug which causes a correct test to fail. This case should not be taken lightly, and a serious effort is needed to be convinced that this is really a Cassandra bug and not our misunderstanding of what Cassandra does. In this case the test should be marked "cassandra_bug" and a detailed comment should explain why. 4. Or it can be an outright bug in the test that caused it to fail on Cassandra. This test had most of these cases :-) There was a test bug in one place (in a Cassandra-specific Java UDF), a minor and (aruably) acceptable difference between the error codes returned by Scylla and Cassandra in one case, and two minor Cassandra bugs (in the error path). All of these are fixed here, and after this patch test/cql-pytest/run-cassandra no longer fails on this file. Fixes scylladb#15969 Signed-off-by: Nadav Har'El <nyh@scylladb.com>
…dra' from Nadav Har'El This short series fixes test/cql-pytest/test_permissions.py to stop failing on Cassandra. The second patch fixes these failures (and explains why). The first patch is a new test for UDFs, which helped me prove that one of the test_permissions.py failures in Cassandra is a Cassandra bug - some esoteric error path that prints the right message when no permissions are involved, becomes wrong when permissions are added. Fixes #15969 Closes #15979 * github.com:scylladb/scylladb: test/cql-pytest: fix test_permissions.py to not fail on Cassandra test/cql-pytest: add test for DROP FUNCTION
Only affects running cql-pytest against C*, not backporting. |
Some tests in
test/cql-pytest/test_permissions.py
fail on Cassandra (I used Cassandra 4.1.1), i.e., the commandTwo tests fail:
test_drop_udf_with_same_name
fails in line 216, trying to use a body1"(i int) CALLED ON NULL INPUT RETURNS bigint LANGUAGE java AS 'return 42;'"
says:Java source compilation failed: Line 1: Type mismatch: cannot convert from int to Long
. I guess Java when used in UDF can't promote integer types. How did this ever work before?test_grant_perms_on_nonexistent_udf
fails in line 321, saying "cassandra.protocol.ConfigurationException Keyspace ks doesn't exist". The error message is expected, but the test expects InvalidRequest instead of ConfugrationException. The test should probably be changed to allow both - this is unfortunately a common difference between Scylla and Cassandra and we usually just allow both in affected tests.The text was updated successfully, but these errors were encountered: