diff --git a/ansi-tests/compileit.lsp b/ansi-tests/compileit.lsp
index 167cbbed8066444f2f69e0886f79e5c61455eacf..1facfe0b2e5785352dfa5b799e05a3ed563c6099 100644
--- a/ansi-tests/compileit.lsp
+++ b/ansi-tests/compileit.lsp
@@ -21,6 +21,12 @@
   (rt:disable-note :assume-no-gray-streams))
 
 (in-package :cl-test)
+
+;;; These two tests will misbehave if the tests are being
+;;; invoked from a file that is being loaded, so remove them
+(when *load-pathname*
+  (mapc #'regression-test:rem-test '(load-pathname.1 load-truename.1)))
+
 (time (regression-test:do-tests))
 
 #+allegro :exit