HyukjinKwon commented on code in PR #59265:
URL: https://github.com/apache/spark/pull/59265#discussion_r4225634009
##########
core/src/main/resources/org/apache/spark/ui/static/table.js:
##########
@@ -63,6 +63,16 @@ function expandAllThreadStackTrace(toggleButton) {
}
/* eslint-enable no-unused-vars */
+// Builds the file in the browser (as the SQL plan download does) rather than
linking to a data:
+// URI, which browsers truncate at the first '#'.
+function downloadThreadDump(fileName) {
Review Comment:
**Nit (P3):** Nothing in `core/src/test` or `ui-test/tests` exercises this
branch or the `downloadThreadDump` helper. If it regressed, the silent
truncation this PR fixes could come back without CI noticing. Examples: this
condition gets inverted, `thread-dump-text` is renamed on only one side, or the
helper reads a truncated source.
The PR notes that HtmlUnit can't run the Blob click, but neither half needs
a real download:
- **Helper:** `ui-test/tests` is a jest/jsdom suite that runs in CI. It
already loads classic static scripts, as `spark-sql-viz.test.js` does, so a
test can load `table.js`, stub `URL.createObjectURL` to capture the Blob, and
check it against a `<pre id="thread-dump-text">` that contains a `...worker#N`
thread followed by more threads.
- **Rendering:** `UISeleniumSuite` (through `goToUi`), or a direct
`render()` call as in `DriverLogPageSuite`, can check the markup each config
value produces.
**Verification:**
- **Regression:** Calling the download helper on embedded text that contains
'worker#N' followed by more threads yields a Blob whose text equals the
complete embedded text and uses the requested file name.
- **Behavior:** Rendering the executor thread dump page with the default
config produces the hidden dump element holding every thread and a Download
control with no data: URI.
- **Compatibility:** Rendering the page with the kill switch disabled
reproduces the legacy data: URI Download link.
--
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]