Skip to content

Commit

Permalink
test with force rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
Glutamat42 committed May 13, 2024
1 parent 1f76e78 commit d743aae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ public function test_delete_instance_failure_due_to_question_deletion_failure()
try {
// Try to delete the complex instance.
adleradaptivity_delete_instance($complex_adleradaptivity_module['module']->id);
} catch (Exception $e) {
// Roll back the transaction before re-throwing the exception
$DB->force_transaction_rollback();
throw $e;
} finally {
sleep(60);
// sleep(60);
// Ensure that no instances were deleted.
$this->assertCount(1, $DB->get_records('adleradaptivity'));
$this->assertCount(2, $DB->get_records('adleradaptivity_tasks'));
Expand Down

0 comments on commit d743aae

Please sign in to comment.