Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/sql/sqlstats: de-flake TestTransactionInsightsFailOnCommit
Fixes: #117061 TestTransactionInsightsFailOnCommit runs two transactions, one of which is expected to fail on commit due to an isolation error as it interacts with the other transaction. We query crdb_internal.node_txn_execution_insights, which queries the in-memory insights data, to check that a txn insight was generated for the failed txn with a `FailedExecution` insight. However, when querying the crdb_internal table, the query is too broad. In the test, the successful transaction can still possibly generate a `SlowExecution` insight. In this case, when looking for the `FailedExecution` insight, we were instead getting an insight from the successful transaction. The fix is to narrow the SELECT criteria to ensure we're selecting the correct insight. The fix also expands the failed assertion logging. Release note: none
- Loading branch information