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

[YSQL] Support assertThrows in the org.yb.AssertionWrappers #23899

Closed
1 task done
d-uspenskiy opened this issue Sep 12, 2024 · 0 comments
Closed
1 task done

[YSQL] Support assertThrows in the org.yb.AssertionWrappers #23899

d-uspenskiy opened this issue Sep 12, 2024 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@d-uspenskiy
Copy link
Contributor

d-uspenskiy commented Sep 12, 2024

Jira Link: DB-12803

Description

assertThrows from JUnit helps to improve readability of java unit tests in some cases.

Original code

      try {
        s1.executeBatch();
        fail("Internal retries are not supported in batched execution mode");
      } catch (BatchUpdateException e) {
        LOG.info(e.toString());
      }

Same code with assertThrows

      assertThrows(BatchUpdateException.class, () -> s1.executeBatch());

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@d-uspenskiy d-uspenskiy added kind/enhancement This is an enhancement of an existing feature area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Sep 12, 2024
@d-uspenskiy d-uspenskiy self-assigned this Sep 12, 2024
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Sep 12, 2024
@d-uspenskiy d-uspenskiy changed the title [YSQL] Support assertThrows in the AssertionWrappers [YSQL] Support assertThrows in the org.yb.AssertionWrappers Sep 12, 2024
d-uspenskiy added a commit that referenced this issue Sep 16, 2024
Summary:
The `assertThrows` method of JUnit helps to improve readability of java unit tests in some cases.

Original code

```
      try {
        s1.executeBatch();
        fail("Internal retries are not supported in batched execution mode");
      } catch (BatchUpdateException e) {
        LOG.info(e.toString());
      }
```

Same code with `assertThrows`

```
      assertThrows("Internal retries are not supported in batched execution mode", BatchUpdateException.class, () -> s1.executeBatch());
```

**Note:** JUnit supports `assertThrows` since version 4.13, so the version was updated
Jira: DB-12803

Test Plan: Jenkins

Reviewers: patnaik.balivada, tfoucher, tnayak

Reviewed By: patnaik.balivada

Subscribers: yql

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D38002
jasonyb pushed a commit that referenced this issue Sep 16, 2024
Summary:
 027ce5b [doc] Configure CLion database project (#23856)
 3d59575 [docs] changed flag "enable_pg_parity_early_access" to "enable_pg_parity_tech_preview" in stable (#23909)
 ec951f8 [PLAT-14590] Fix permission check for otel-collector file existence check
 77f1c3a [PLAT-15212] Failover local provider test should validate safetime is restored during failover
 04a36f8 [DOC-444] [2.23] Lightweight DB clone (#23515)
 2809658 [PLAT-15145] Consume universe marker field for node-agent installation to decide the client type
 a3c7a31 [PLAT-15052][PLAT-8144] Airgap improvement to preprovision
 Excluded: 24a5af0 [#3946] YSQL: Add support for ALTER TABLE ... VALIDATE CONSTRAINT
 Excluded: 2ac2e98 [#23118] YSQL: Add support for ADD PRIMARY KEY ... USING INDEX
 ea51592 [DEVOPS-3234] yb_release: Change clean step error to warning
 72c91c4 [docs] Release notes for 2.23.0.0-b710 (#23687)
 e9ec9e2 [#23846] Support for automatically syncing inline third-party dependencies
 1977cf7 [#23766] docdb: Get colocated schema_version correctly in ChangeMetadataOperation
 02a4bac [#23896] Changing the pg-parity flag from --enable_pg_parity_tech_preview to --enable_pg_parity_early_access.
 dbddb04 [#23814] docs: Add log_dist option to auto_explain page. (#23921)
 56a9b49 [#23886] docdb: Fix load balancer leader balancing for geopartitioned tables
 48112fb [doc][yba] Warning for disk encryption agent (#23850)
 Excluded: 06baaf0 [#23314] YSQL: Prevent moving a single colocated table to a different tablespace
 886a2a0 [PLAT-15310] Fix failing UT on master for K8s service IPs
 f157e2e [#23917] xCluster: set up sequences_data stream(s) on source universe
 9d4b6e0 [PLAT-15302] Remove parallel query from enhanced PG parity gflags
 d50282d [doc] Fix RSS link (#23932)
 6990c7a [PLAT-15306] Update YBA node agent TLS certs to use strong ciphers
 d6e81df [PLAT-15325] Pass the region_name during YNP installation
 2ba8180 [PLAT-14883][Azure] OS upgrades seems to be leaving over unattached disks
 64aa030 [PLAT-15231]Query Regex not working in logs page - [PLAT-15235] [PLAT-15239][PLAT-15240][PLAT-15241][PLAT-15243]
 e9ab17d [#23835] ASH: Update the field in /rpcz from yql_endpoint_tserver_uuid to top_level_node_id
 c853c56 [#23899] YSQL: Support assertThrows in the org.yb.AssertionWrappers
 fdf8a67 [PLAT-15295] Use Pagination for querying LDAP server
 59fa2cd [PLAT-15295] Use Pagination for querying LDAP server
 af83ee5 [PLAT-15261][Master]Backups created through the Scheduled Backup feature are incorrectly tagged under the login user
 55b4187 [PLAT-15320][YBA CLI]K8s Universes throw `interface {} is string, not []float64` error

Test Plan: Jenkins: rebase: pg15-cherrypicks

Reviewers: jason, tfoucher

Differential Revision: https://phorge.dev.yugabyte.com/D38078
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
Status: Done
Development

No branches or pull requests

2 participants