Skip to content

Commit

Permalink
test: Ignore c3 data_types null crashes
Browse files Browse the repository at this point in the history
This gets triggered by the CPUUsage DonutChart in
pkg/kubernetes/scripts/virtual-machines/components/VmMetricsTab.jsx.

This seems to be some race condition when switching pages, which
supposedly also means "(un)render in React". Cockpit code has no control
over this, and it also does not break the user experience, so ignore the
exception.

See c3js/c3#2187 and simlilar issues
bcbcarl/react-c3js#22 or
c3js/c3#1205.

Cherry-picked from master commit 436bfe4.
  • Loading branch information
martinpitt committed Jul 29, 2018
1 parent 61b328d commit 2b3206c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/common/cdp-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,15 @@ function setupLogging(client) {
if (details.exception && details.exception.className === "PhWaitCondTimeout")
return;

unhandledExceptions.push(details)
process.stderr.write(details.description || JSON.stringify(details) + "\n");

// ignore c3 crashes (https://github.com/c3js/c3/issues/2187)
if (details.exception && details.exception.description &&
details.exception.description.indexOf("TypeError: Cannot read property 'data_types' of null") >= 0 &&
details.exception.description.indexOf("/kubernetes.js") >= 0)
return;

unhandledExceptions.push(details)
});

client.Log.enable();
Expand Down

0 comments on commit 2b3206c

Please sign in to comment.