bito-code-review[bot] commented on PR #42315:
URL: https://github.com/apache/superset/pull/42315#issuecomment-5050847114
<!-- Bito Reply -->
The review comment correctly identifies a resource leak in the test suite.
Failing to dispose of ECharts instances in tests can lead to memory
accumulation and potential interference between tests. To resolve this, you
should ensure `chart.dispose()` is called after the assertions, ideally within
a `finally` block to guarantee execution even if assertions fail.
Here is the recommended fix for the test file:
```typescript
// Inside the test case
const chart = init(null, null, { renderer: 'svg', locale: 'EN' });
chart.setOption({ ... });
try {
expect(chart.renderToSVGString()).toBeDefined();
} finally {
chart.dispose();
}
```
I have checked the available review comments for this PR, and there are no
other actionable suggestions currently listed in the review thread. Would you
like me to perform any other checks or assist with further improvements?
**superset-frontend/plugins/plugin-chart-echarts/test/components/echartsLocale.test.ts**
```
try {
expect(chart.renderToSVGString()).toBeDefined();
} finally {
chart.dispose();
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]