Skip to content
Snippets Groups Projects
Verified Commit 79122510 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: tests

parent 1f1348ae
No related branches found
No related tags found
No related merge requests found
...@@ -5,20 +5,8 @@ ...@@ -5,20 +5,8 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9979eb22-471e-4f2f-b624-fd3edb5e8c6e" name="Changes" comment=""> <list default="true" id="9979eb22-471e-4f2f-b624-fd3edb5e8c6e" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.gitlab-ci.yml" beforeDir="false" afterPath="$PROJECT_DIR$/.gitlab-ci.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-1_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-1_test.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/manager_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/manager_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-2_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-2_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-3_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-3_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-4_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-4_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-5_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-5_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-6_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-6_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-7_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-7_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database-8_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database-8_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/database_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/job-syncer_test.go" beforeDir="false" afterPath="$PROJECT_DIR$/job-syncer_test.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/nix/scripts/common.nix" beforeDir="false" afterPath="$PROJECT_DIR$/nix/scripts/common.nix" afterDir="false" />
<change beforePath="$PROJECT_DIR$/nix/scripts/deploy.nix" beforeDir="false" afterPath="$PROJECT_DIR$/nix/scripts/deploy.nix" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -57,6 +45,7 @@ ...@@ -57,6 +45,7 @@
"keyToString": { "keyToString": {
"DefaultGoTemplateProperty": "Go File", "DefaultGoTemplateProperty": "Go File",
"Go Test.TestDummyRunnable in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", "Go Test.TestDummyRunnable in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug",
"Go Test.TestManagerEventHandling in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug",
"Go Test.TestResetStats in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", "Go Test.TestResetStats in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug",
"Go Test.TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", "Go Test.TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug",
"Go Test.TestScheduleJob in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug", "Go Test.TestScheduleJob in gitlab.schukai.com/oss/libraries/go/services/job-queues.executor": "Debug",
...@@ -92,7 +81,7 @@ ...@@ -92,7 +81,7 @@
<recent name="$PROJECT_DIR$/.back" /> <recent name="$PROJECT_DIR$/.back" />
</key> </key>
</component> </component>
<component name="RunManager" selected="Go Test.TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues"> <component name="RunManager" selected="Go Test.TestManagerEventHandling in gitlab.schukai.com/oss/libraries/go/services/job-queues">
<configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application"> <configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="job-queues" /> <module name="job-queues" />
<working_directory value="$PROJECT_DIR$" /> <working_directory value="$PROJECT_DIR$" />
...@@ -102,7 +91,7 @@ ...@@ -102,7 +91,7 @@
<filePath value="$PROJECT_DIR$" /> <filePath value="$PROJECT_DIR$" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="TestDummyRunnable in gitlab.schukai.com/oss/libraries/go/services/job-queues" type="GoTestRunConfiguration" factoryName="Go Test" temporary="true" nameIsGenerated="true"> <configuration name="TestManagerEventHandling in gitlab.schukai.com/oss/libraries/go/services/job-queues" type="GoTestRunConfiguration" factoryName="Go Test" temporary="true" nameIsGenerated="true">
<module name="job-queues" /> <module name="job-queues" />
<working_directory value="$PROJECT_DIR$" /> <working_directory value="$PROJECT_DIR$" />
<kind value="PACKAGE" /> <kind value="PACKAGE" />
...@@ -110,7 +99,7 @@ ...@@ -110,7 +99,7 @@
<directory value="$PROJECT_DIR$" /> <directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" /> <filePath value="$PROJECT_DIR$" />
<framework value="gotest" /> <framework value="gotest" />
<pattern value="^\QTestDummyRunnable\E$" /> <pattern value="^\QTestManagerEventHandling\E$" />
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues" type="GoTestRunConfiguration" factoryName="Go Test" temporary="true" nameIsGenerated="true"> <configuration name="TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues" type="GoTestRunConfiguration" factoryName="Go Test" temporary="true" nameIsGenerated="true">
...@@ -169,11 +158,11 @@ ...@@ -169,11 +158,11 @@
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Go Test.TestManagerEventHandling in gitlab.schukai.com/oss/libraries/go/services/job-queues" />
<item itemvalue="Go Test.TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues" /> <item itemvalue="Go Test.TestRoundTrip in gitlab.schukai.com/oss/libraries/go/services/job-queues" />
<item itemvalue="Go Test.TestWriteToDB4 in gitlab.schukai.com/oss/libraries/go/services/job-queues" /> <item itemvalue="Go Test.TestWriteToDB4 in gitlab.schukai.com/oss/libraries/go/services/job-queues" />
<item itemvalue="Go Test.TestWriteToDB1 in gitlab.schukai.com/oss/libraries/go/services/job-queues" /> <item itemvalue="Go Test.TestWriteToDB1 in gitlab.schukai.com/oss/libraries/go/services/job-queues" />
<item itemvalue="Go Test.TestWriteToDB2 in gitlab.schukai.com/oss/libraries/go/services/job-queues" /> <item itemvalue="Go Test.TestWriteToDB2 in gitlab.schukai.com/oss/libraries/go/services/job-queues" />
<item itemvalue="Go Test.TestDummyRunnable in gitlab.schukai.com/oss/libraries/go/services/job-queues" />
</list> </list>
</recent_temporary> </recent_temporary>
</component> </component>
......
...@@ -246,7 +246,7 @@ func TestManagerEventHandling(t *testing.T) { ...@@ -246,7 +246,7 @@ func TestManagerEventHandling(t *testing.T) {
runner := &CounterRunnable{} runner := &CounterRunnable{}
job := NewJob[CounterResult]("job1", runner) job := NewJob[CounterResult]("job1", runner)
scheduler := &IntervalScheduler{Interval: 1 * time.Millisecond} scheduler := &IntervalScheduler{Interval: 2 * time.Millisecond}
err = mgr.ScheduleJob(job, scheduler) err = mgr.ScheduleJob(job, scheduler)
assert.Nil(t, err) assert.Nil(t, err)
...@@ -260,11 +260,12 @@ func TestManagerEventHandling(t *testing.T) { ...@@ -260,11 +260,12 @@ func TestManagerEventHandling(t *testing.T) {
time.Sleep(2 * time.Millisecond) time.Sleep(2 * time.Millisecond)
if time.Since(startTime) > 1*time.Second { if time.Since(startTime) > 100*time.Millisecond {
t.Fatalf("Job did not finish in time") t.Fatalf("Job did not finish in time")
} }
} }
time.Sleep(2 * time.Millisecond)
err = mgr.Stop() err = mgr.Stop()
assert.Nil(t, err) assert.Nil(t, err)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment