diff --git a/src/os/inc/osSpec.h b/src/os/inc/osSpec.h
index 48ec6ae04f189184af1ef84ada3678b60ea48c37..d93a6472064cc68f334eb53ec58218984c696765 100644
--- a/src/os/inc/osSpec.h
+++ b/src/os/inc/osSpec.h
@@ -338,14 +338,15 @@ void taosRemoveDir(char *rootDir);
int taosMkDir(const char *pathname, mode_t mode);
void taosMvDir(char* destDir, char *srcDir);
-
-
#ifdef TAOS_RANDOM_FILE_FAIL
void taosSetRandomFileFailFactor(int factor);
void taosSetRandomFileFailOutput(const char *path);
ssize_t taosReadFileRandomFail(int fd, void *buf, size_t count, const char *file, uint32_t line);
ssize_t taosWriteFileRandomFail(int fd, void *buf, size_t count, const char *file, uint32_t line);
off_t taosLSeekRandomFail(int fd, off_t offset, int whence, const char *file, uint32_t line);
+ #undef taosTRead
+ #undef taosTWrite
+ #undef taosLSeek
#define taosTRead(fd, buf, count) taosReadFileRandomFail(fd, buf, count, __FILE__, __LINE__)
#define taosTWrite(fd, buf, count) taosWriteFileRandomFail(fd, buf, count, __FILE__, __LINE__)
#define taosLSeek(fd, offset, whence) taosLSeekRandomFail(fd, offset, whence, __FILE__, __LINE__)
@@ -356,6 +357,10 @@ void taosMvDir(char* destDir, char *srcDir);
ssize_t taosSendToRandomFail(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);
ssize_t taosReadSocketRandomFail(int fd, void *buf, size_t count);
ssize_t taosWriteSocketRandomFail(int fd, const void *buf, size_t count);
+ #undef taosSend
+ #undef taosSendto
+ #undef taosReadSocket
+ #undef taosWriteSocket
#define taosSend(sockfd, buf, len, flags) taosSendRandomFail(sockfd, buf, len, flags)
#define taosSendto(sockfd, buf, len, flags, dest_addr, addrlen) taosSendToRandomFail(sockfd, buf, len, flags, dest_addr, addrlen)
#define taosReadSocket(fd, buf, len) taosReadSocketRandomFail(fd, buf, len)
diff --git a/src/tsdb/src/tsdbMain.c b/src/tsdb/src/tsdbMain.c
index 3a453249a99ec854205982a1e1536c9283b8ccbd..895bd4ae517acfefb7853284259c50fa06cae2af 100644
--- a/src/tsdb/src/tsdbMain.c
+++ b/src/tsdb/src/tsdbMain.c
@@ -12,6 +12,10 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
+
+// no test file errors here
+#undef TAOS_RANDOM_FILE_FAIL
+
#include "tsdbMain.h"
#include "os.h"
#include "talgo.h"
@@ -22,8 +26,6 @@
#include "ttime.h"
#include "tulog.h"
-#include
-#include
#define TSDB_CFG_FILE_NAME "config"
#define TSDB_DATA_DIR_NAME "data"
diff --git a/src/util/src/tlog.c b/src/util/src/tlog.c
index 2489ae56bee19bec706a31ce593e78bad9e55a8e..96ae417297c934e71ecf1feb1ab1ff849da702d7 100644
--- a/src/util/src/tlog.c
+++ b/src/util/src/tlog.c
@@ -14,6 +14,9 @@
*/
#define _DEFAULT_SOURCE
+// no test file errors here
+#undef TAOS_RANDOM_FILE_FAIL
+
#include "os.h"
#include "tulog.h"
#include "tlog.h"
diff --git a/src/util/src/tnote.c b/src/util/src/tnote.c
index fdf11eb5c4bcfa1f75e7d9ddffad840f1ca609b7..91916c92d7f1feb2b7b594ae1d7541cb95e4db07 100644
--- a/src/util/src/tnote.c
+++ b/src/util/src/tnote.c
@@ -13,6 +13,9 @@
* along with this program. If not, see .
*/
+// no test file errors here
+#undef TAOS_RANDOM_FILE_FAIL
+
#include "tnote.h"
taosNoteInfo m_HttpNote;