1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2025-03-31 01:24:31 +00:00

fixed test for errorKernel

This commit is contained in:
postmannen 2022-02-07 06:18:59 +01:00
parent b3630f62c4
commit 77b89cdfb9

View file

@ -230,19 +230,15 @@ func checkREQHelloTest(stewardServer *server, conf *Configuration, t *testing.T)
// Check the error logger type.
func checkREQErrorLogTest(stewardServer *server, conf *Configuration, t *testing.T) error {
m := `[
{
"directory": "errorLog",
"fileName":"fileName.result",
"toNode": "errorCentral",
"data": ["some error"],
"method": "REQErrorLog"
}
]`
m := Message{
ToNode: "somenode",
}
writeToSocketTest(conf, m, t)
p := newProcess(stewardServer.ctx, stewardServer.metrics, stewardServer.natsConn, stewardServer.processes, stewardServer.processInitial.toRingbufferCh, stewardServer.configuration, Subject{}, stewardServer.errorKernel.errorCh, processKindSubscriber, nil, stewardServer.signatures)
resultFile := filepath.Join(conf.SubscribersDataFolder, "errorLog", "errorCentral", "fileName.result")
stewardServer.errorKernel.errSend(p, m, fmt.Errorf("some error"))
resultFile := filepath.Join(conf.SubscribersDataFolder, "errorLog", "errorCentral", "error.log")
_, err := findStringInFileTest("some error", resultFile, conf, t)
if err != nil {
return fmt.Errorf(" \U0001F631 [FAILED] : checkREQErrorLogTest: %v", err)