Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Jitter for maxJobs option
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Plakhotnikov <embargo2710@gmail.com>
  • Loading branch information
Kaspiman committed Mar 11, 2024
1 parent eac7d93 commit 0b7300a
Showing 1 changed file with 11 additions and 64 deletions.
75 changes: 11 additions & 64 deletions ipc/socket/socket_factory_spawn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"net"
"os/exec"
"sync"
"syscall"
"testing"
"time"

Expand All @@ -22,9 +21,7 @@ func Test_Tcp_Start2(t *testing.T) {
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand Down Expand Up @@ -87,9 +84,7 @@ func Test_Tcp_StartError2(t *testing.T) {
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand Down Expand Up @@ -137,9 +132,7 @@ func Test_Tcp_Invalid2(t *testing.T) {
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand All @@ -160,9 +153,7 @@ func Test_Tcp_Broken2(t *testing.T) {
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand Down Expand Up @@ -202,9 +193,7 @@ func Test_Tcp_Echo2(t *testing.T) {
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand Down Expand Up @@ -237,16 +226,11 @@ func Test_Tcp_Echo2(t *testing.T) {
}

func Test_Unix_Start2(t *testing.T) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand All @@ -269,16 +253,11 @@ func Test_Unix_Start2(t *testing.T) {
}

func Test_Unix_Failboot2(t *testing.T) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand All @@ -295,16 +274,11 @@ func Test_Unix_Failboot2(t *testing.T) {
}

func Test_Unix_Timeout2(t *testing.T) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand All @@ -323,16 +297,11 @@ func Test_Unix_Timeout2(t *testing.T) {
}

func Test_Unix_Invalid2(t *testing.T) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand All @@ -349,16 +318,11 @@ func Test_Unix_Invalid2(t *testing.T) {
}

func Test_Unix_Broken2(t *testing.T) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand Down Expand Up @@ -393,16 +357,11 @@ func Test_Unix_Broken2(t *testing.T) {
}

func Test_Unix_Echo2(t *testing.T) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(t, err) {
defer func() {
errC := ls.Close()
if errC != nil {
t.Errorf("error closing the listener: error %v", err)
}
require.NoError(t, errC)
}()
} else {
t.Skip("socket is busy")
Expand Down Expand Up @@ -438,9 +397,6 @@ func Test_Unix_Echo2(t *testing.T) {
}

func Benchmark_Tcp_SpawnWorker_Stop2(b *testing.B) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(b, err) {
defer func() {
Expand Down Expand Up @@ -473,9 +429,6 @@ func Benchmark_Tcp_SpawnWorker_Stop2(b *testing.B) {
}

func Benchmark_Tcp_Worker_ExecEcho2(b *testing.B) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if assert.NoError(b, err) {
defer func() {
Expand Down Expand Up @@ -512,9 +465,6 @@ func Benchmark_Tcp_Worker_ExecEcho2(b *testing.B) {
}

func Benchmark_Unix_SpawnWorker_Stop2(b *testing.B) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if err == nil {
defer func() {
Expand Down Expand Up @@ -543,9 +493,6 @@ func Benchmark_Unix_SpawnWorker_Stop2(b *testing.B) {
}

func Benchmark_Unix_Worker_ExecEcho2(b *testing.B) {
defer func() {
_ = syscall.Unlink("sock.unix")
}()
ls, err := net.Listen("unix", "sock.unix")
if err == nil {
defer func() {
Expand Down

0 comments on commit 0b7300a

Please sign in to comment.