From c61756635c0d1b25b304627c8a693f2e9e2ee4b3 Mon Sep 17 00:00:00 2001 From: Valery Piashchynski Date: Fri, 23 Jul 2021 20:50:24 +0300 Subject: SQS initial durability test Signed-off-by: Valery Piashchynski --- tests/plugins/jobs/helpers.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests/plugins/jobs/helpers.go') diff --git a/tests/plugins/jobs/helpers.go b/tests/plugins/jobs/helpers.go index 27b2d1e0..d8c32a49 100644 --- a/tests/plugins/jobs/helpers.go +++ b/tests/plugins/jobs/helpers.go @@ -81,6 +81,33 @@ func pushToPipe(pipeline string) func(t *testing.T) { } } +func pushToPipeExpectErr(pipeline string) func(t *testing.T) { + return func(t *testing.T) { + conn, err := net.Dial("tcp", "127.0.0.1:6001") + assert.NoError(t, err) + client := rpc.NewClientWithCodec(goridgeRpc.NewClientCodec(conn)) + + req := &jobsv1beta.PushRequest{Job: &jobsv1beta.Job{ + Job: "some/php/namespace", + Id: "1", + Payload: `{"hello":"world"}`, + Headers: map[string]*jobsv1beta.HeaderValue{"test": {Value: []string{"test2"}}}, + Options: &jobsv1beta.Options{ + Priority: 1, + Pipeline: pipeline, + Delay: 0, + Attempts: 0, + RetryDelay: 0, + Timeout: 0, + }, + }} + + er := &jobsv1beta.Empty{} + err = client.Call("jobs.Push", req, er) + require.Error(t, err) + } +} + func pausePipelines(pipes ...string) func(t *testing.T) { return func(t *testing.T) { conn, err := net.Dial("tcp", "127.0.0.1:6001") -- cgit v1.2.3