Skip to content

Commit

Permalink
tests: fix occasional chrome console errors
Browse files Browse the repository at this point in the history
    [file:///.../Thruk/t/:45:8] Uncaught: TypeError: Cannot read properties of null (reading 'appendChild')
        at addRow (file:///.../Thruk/t/:46:9)
        at file:///.../Thruk/t/:238:9
    [file:///.../Thruk/t/:45:8] Uncaught: TypeError: Cannot read properties of null (reading 'appendChild')
        at addRow (file:///.../Thruk/t/:46:9)
        at file:///.../Thruk/t/:239:9

those errors are from the directory index page of chrome itself.
  • Loading branch information
sni committed Sep 3, 2024
1 parent fbcc9c5 commit 50a36a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -2057,6 +2057,7 @@ t/900-javascript_syntax.t
t/900-javascript_utils.t
t/ci/thruk_local.conf
t/data/800-plugins/01-css.t
t/data/blank.html
t/data/broken_config/a.conf
t/data/broken_config/b.conf
t/data/broken_config2/a.conf
Expand Down
11 changes: 1 addition & 10 deletions t/TestUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1276,16 +1276,7 @@ sub js_init {
tab => 'current',
launch_arg => ["--password-store=basic", "--remote-allow-origins=*"],
);
$mech->get_local(".");
eval {
$mech->update_html("");
};
if($@) {
# retry once because of occasional: Could not find node with given id
# -32000 at .../lib/perl5/Chrome/DevToolsProtocol/Target.pm line 508
sleep(2);
$mech->update_html("");
}
$mech->get_local("./data/blank.html");
$mech->clear_js_errors();

my $console = $mech->add_listener('Runtime.consoleAPICalled', sub {
Expand Down
2 changes: 2 additions & 0 deletions t/data/blank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<html>
</html>

0 comments on commit 50a36a1

Please sign in to comment.