Skip to content

Commit

Permalink
WR #432782: Moodle 4.4 fixing heartbeat causing behat to fail
Browse files Browse the repository at this point in the history
For some reason a debugging message was causing all the behat tests
to fail when heartbeat was running on the site so I added a check
to not run the debugging message when a behat test is running.
  • Loading branch information
waleedhassan5 authored and brendanheywood committed Dec 18, 2024
1 parent 72e8420 commit 7f935ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/check/cachecheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ public static function ping($type) {
// This should help detect any cache replication delays.
$readbackvalue = self::get_cache_ping_value($type);

debugging("\nHEARTBEAT doing {$type} ping\n", DEBUG_DEVELOPER);
// Checking if behat site is running.
if (!(defined('BEHAT_SITE_RUNNING') && BEHAT_SITE_RUNNING)) {
debugging("\nHEARTBEAT doing {$type} ping\n", DEBUG_DEVELOPER);
}

if (get_config('tool_heartbeat', 'shouldlogcacheping')) {
lib::record_cache_pinged($currentcache, $currentdb, $time, $readbackvalue, $type);
Expand Down

0 comments on commit 7f935ca

Please sign in to comment.