Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
maestro-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
maestro
maestro-core
Commits
4e78c281
Commit
4e78c281
authored
3 years ago
by
Ali Mohammed
Browse files
Options
Downloads
Patches
Plain Diff
add a sync cdo to avoid races in check_pm_redundant_interlock test
parent
6a1b74fb
Branches
Branches containing commit
No related tags found
1 merge request
!48
Resolve "Possible race in check_pm_redundant_interlock test"
Pipeline
#87528
passed
3 years ago
Stage: build-and-test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/Makefile.am
+78
-50
78 additions, 50 deletions
tests/Makefile.am
tests/check_pm_redundant_interlock.sh.in
+5
-2
5 additions, 2 deletions
tests/check_pm_redundant_interlock.sh.in
with
83 additions
and
52 deletions
tests/Makefile.am
+
78
−
50
View file @
4e78c281
...
@@ -129,7 +129,9 @@ check_PROGRAMS = check_version check_init check_uuid \
...
@@ -129,7 +129,9 @@ check_PROGRAMS = check_version check_init check_uuid \
simple_group_client
\
simple_group_client
\
simple_group_injector
\
simple_group_injector
\
simple_interlock_client_1
\
simple_interlock_client_1
\
redundant_interlock_client_1
\
simple_interlock_client_2
\
simple_interlock_client_2
\
redundant_interlock_client_2
\
colliding_client_1
\
colliding_client_1
\
colliding_client_2
\
colliding_client_2
\
reentrant_client
\
reentrant_client
\
...
@@ -165,6 +167,16 @@ CLIENT1_OPS="DECLARE cdo1 1025\
...
@@ -165,6 +167,16 @@ CLIENT1_OPS="DECLARE cdo1 1025\
DISPOSE cdo1 -1
\
DISPOSE cdo1 -1
\
DISPOSE cdo2 -1"
DISPOSE cdo2 -1"
R_CLIENT1_OPS
=
"DECLARE cdo1a 11
\
SEAL cdo1a -1
\
DECLARE cdo2 20480
\
REQUIRE cdo2 -1
\
OFFER cdo1a -1
\
DEMAND cdo2 -1
\
WITHDRAW cdo1a -1
\
DISPOSE cdo1a -1
\
DISPOSE cdo2 -1"
CLIENT2_OPS
=
"DECLARE cdo2 20480
\
CLIENT2_OPS
=
"DECLARE cdo2 20480
\
SEAL cdo2 -1
\
SEAL cdo2 -1
\
DECLARE cdo1 1025
\
DECLARE cdo1 1025
\
...
@@ -177,6 +189,17 @@ CLIENT2_OPS="DECLARE cdo2 20480\
...
@@ -177,6 +189,17 @@ CLIENT2_OPS="DECLARE cdo2 20480\
DISPOSE cdo2 -1
\
DISPOSE cdo2 -1
\
DISPOSE cdo1 -1"
DISPOSE cdo1 -1"
R_CLIENT2_OPS
=
"DECLARE cdo2 20480
\
SEAL cdo2 -1
\
DECLARE cdo1 1025
\
REQUIRE cdo1 -1
\
DECLARE cdo1a 11 REQUIRE cdo1a -1
\
OFFER cdo2 -1
\
DEMAND cdo1 -1
\
DEMAND cdo1a -1 DISPOSE cdo1a -1
\
WITHDRAW cdo2 -1
\
DISPOSE cdo2 -1
\
DISPOSE cdo1 -1"
ASYNC_CLIENT1_OPS
=
" DECLARE cdo1 1025
\
ASYNC_CLIENT1_OPS
=
" DECLARE cdo1 1025
\
DECLARE cdo2 1024
\
DECLARE cdo2 1024
\
...
@@ -247,6 +270,11 @@ simple_interlock_client_1_CPPFLAGS = $(AM_CPPFLAGS) -DCOMPONENT_ID=1 -DCLIENT_A
...
@@ -247,6 +270,11 @@ simple_interlock_client_1_CPPFLAGS = $(AM_CPPFLAGS) -DCOMPONENT_ID=1 -DCLIENT_A
simple_interlock_client_2_SOURCES
=
simple_interlock_client.c
simple_interlock_client_2_SOURCES
=
simple_interlock_client.c
simple_interlock_client_2_CPPFLAGS
=
$(
AM_CPPFLAGS
)
-DCOMPONENT_ID
=
2
-DCLIENT_ARGS
=
$(
CLIENT2_OPS
)
simple_interlock_client_2_CPPFLAGS
=
$(
AM_CPPFLAGS
)
-DCOMPONENT_ID
=
2
-DCLIENT_ARGS
=
$(
CLIENT2_OPS
)
redundant_interlock_client_1_SOURCES
=
simple_interlock_client.c
redundant_interlock_client_1_CPPFLAGS
=
$(
AM_CPPFLAGS
)
-DCOMPONENT_ID
=
1
-DCLIENT_ARGS
=
$(
R_CLIENT1_OPS
)
redundant_interlock_client_2_SOURCES
=
simple_interlock_client.c
redundant_interlock_client_2_CPPFLAGS
=
$(
AM_CPPFLAGS
)
-DCOMPONENT_ID
=
2
-DCLIENT_ARGS
=
$(
R_CLIENT2_OPS
)
colliding_client_1_SOURCES
=
colliding_client.c
colliding_client_1_SOURCES
=
colliding_client.c
colliding_client_1_CPPFLAGS
=
$(
AM_CPPFLAGS
)
-DREPETITION
=
1
colliding_client_1_CPPFLAGS
=
$(
AM_CPPFLAGS
)
-DREPETITION
=
1
colliding_client_2_SOURCES
=
colliding_client.c
colliding_client_2_SOURCES
=
colliding_client.c
...
...
This diff is collapsed.
Click to expand it.
tests/check_pm_redundant_interlock.sh.in
+
5
−
2
View file @
4e78c281
...
@@ -49,6 +49,8 @@ PM_CMD="@top_builddir@/tests/simple_pool_manager"
...
@@ -49,6 +49,8 @@ PM_CMD="@top_builddir@/tests/simple_pool_manager"
# 'O' -- offer 'R' -- require -- 'D' demand -- 'W' withdraw
# 'O' -- offer 'R' -- require -- 'D' demand -- 'W' withdraw
# 'S' -- sleep
# 'S' -- sleep
CLIENT_CMD
=
"@top_builddir@/tests/simple_interlock_client"
CLIENT_CMD
=
"@top_builddir@/tests/simple_interlock_client"
R_CLIENT_CMD
=
"@top_builddir@/tests/redundant_interlock_client"
# start pool manager, connect its output to fd 3:
# start pool manager, connect its output to fd 3:
# (we need to run in a subshell to start a new process group)
# (we need to run in a subshell to start a new process group)
...
@@ -95,13 +97,14 @@ export MSTRO_POOL_MANAGER_INFO
...
@@ -95,13 +97,14 @@ export MSTRO_POOL_MANAGER_INFO
(
env
MSTRO_COMPONENT_NAME
=
"Client1"
MSTRO_TRANSPORT_DEFAULT
=
"MIO"
MSTRO_MIO_CONFIG
=
"./mio-config-C1a.yaml"
MSTRO_LOG_COLOR_ERRORS
=
1
MSTRO_LOG_COLOR
=
"BLUE"
${
CLIENT_CMD
}
_1
-n
)
||
exit
99 &
(
env
MSTRO_COMPONENT_NAME
=
"Client1"
MSTRO_TRANSPORT_DEFAULT
=
"MIO"
MSTRO_MIO_CONFIG
=
"./mio-config-C1a.yaml"
MSTRO_LOG_COLOR_ERRORS
=
1
MSTRO_LOG_COLOR
=
"BLUE"
${
CLIENT_CMD
}
_1
-n
)
||
exit
99 &
# start client 1 again (simulating redundant participants)
# start client 1 again (simulating redundant participants)
(
env
MSTRO_COMPONENT_NAME
=
"Client1a"
MSTRO_TRANSPORT_DEFAULT
=
"MIO"
MSTRO_MIO_CONFIG
=
"./mio-config-C1a.yaml"
MSTRO_LOG_COLOR_ERRORS
=
1
MSTRO_LOG_COLOR
=
"BLUE"
${
CLIENT_CMD
}
_1
-n
)
||
exit
99 &
(
env
MSTRO_COMPONENT_NAME
=
"Client1a"
MSTRO_TRANSPORT_DEFAULT
=
"MIO"
MSTRO_MIO_CONFIG
=
"./mio-config-C1a.yaml"
MSTRO_LOG_COLOR_ERRORS
=
1
MSTRO_LOG_COLOR
=
"BLUE"
${
R_
CLIENT_CMD
}
_1
-n
)
||
exit
99 &
# start client 2
# start client 2
(
env
MSTRO_COMPONENT_NAME
=
"Client2"
MSTRO_TRANSPORT_DEFAULT
=
"MIO"
MSTRO_MIO_CONFIG
=
"./mio-config-C2a.yaml"
MSTRO_LOG_COLOR_ERRORS
=
1
MSTRO_LOG_COLOR
=
"CYAN"
${
CLIENT_CMD
}
_2
-n
)
||
exit
99 &
(
env
MSTRO_COMPONENT_NAME
=
"Client2"
MSTRO_TRANSPORT_DEFAULT
=
"MIO"
MSTRO_MIO_CONFIG
=
"./mio-config-C2a.yaml"
MSTRO_LOG_COLOR_ERRORS
=
1
MSTRO_LOG_COLOR
=
"CYAN"
${
R_
CLIENT_CMD
}
_2
-n
)
||
exit
99 &
wait
%1
||
exit
99
wait
%1
||
exit
99
wait
%2
||
exit
99
wait
%2
||
exit
99
wait
%3
||
exit
99
# trap normal script termination: close pipe to pool manager
# trap normal script termination: close pipe to pool manager
terminate
${
PM_PID
}
0
terminate
${
PM_PID
}
0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment