Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
batmen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sepia-pub
mael
batmen
Commits
08bee0d2
Commit
08bee0d2
authored
2 years ago
by
Maël Madon
Browse files
Options
Downloads
Patches
Plain Diff
test: add the case of an undersized plateform file
parent
20245fb4
No related branches found
No related tags found
1 merge request
!2
Feature "replay with feedback" ready and tested
Pipeline
#4513
passed
2 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/distance_batsim_output.py
+2
-2
2 additions, 2 deletions
test/distance_batsim_output.py
test/test_fb_users.py
+54
-7
54 additions, 7 deletions
test/test_fb_users.py
with
56 additions
and
9 deletions
test/distance_batsim_output.py
100644 → 100755
+
2
−
2
View file @
08bee0d2
...
...
@@ -22,7 +22,7 @@ def clean_and_select(df):
select
[
"
job_id
"
]
=
select
[
"
job_id
"
].
str
.
split
(
'
:
'
,
expand
=
True
)[
0
]
select
.
job_id
=
select
.
job_id
.
astype
(
int
)
return
select
.
sort_values
(
by
=
"
job_id
"
)
return
select
.
sort_values
(
by
=
"
job_id
"
)
.
set_index
(
"
job_id
"
)
def
open_and_compare
(
file1
,
file2
):
...
...
@@ -35,7 +35,7 @@ def open_and_compare(file1, file2):
out1
=
clean_and_select
(
out1
)
out2
=
clean_and_select
(
out2
)
if
not
out1
.
job_id
.
equals
(
out2
.
job_id
):
if
not
out1
.
index
.
equals
(
out2
.
index
):
raise
KeyError
(
f
"
{
file1
}
and
{
file2
}
cannot be compared: they don
'
t have the same job_ids
"
)
...
...
This diff is collapsed.
Click to expand it.
test/test_fb_users.py
+
54
−
7
View file @
08bee0d2
...
...
@@ -95,7 +95,7 @@ def test_tt_only_simple_workload():
launch_fb_test_1user
(
user_category
=
'
fb_user_think_time_only
'
,
test_input
=
'
proto_SABjson_v2
'
)
def
assert_
simu_output_are_close_enough
(
out_dir1
,
out_dir2
):
def
simu_output_are_close_enough
(
out_dir1
,
out_dir2
):
"""
Returns true if the jobs.csv in both directories are epsilon-close (for
the normalized euclidean distance) for each of the fields submission time,
start time and finish time.
"""
...
...
@@ -104,9 +104,10 @@ def assert_simu_output_are_close_enough(out_dir1, out_dir2):
dis
=
distances
(
f
"
{
out_dir1
}
/_jobs.csv
"
,
f
"
{
out_dir2
}
/_jobs.csv
"
,
euclidean
=
False
,
norm_eucl
=
True
,
field
=
[
"
submission_time
"
,
"
starting_time
"
,
"
finish_time
"
])
assert
dis
[
"
submission_time
"
][
"
normalized_euclidean
"
]
<
epsilon
assert
dis
[
"
starting_time
"
][
"
normalized_euclidean
"
]
<
epsilon
assert
dis
[
"
finish_time
"
][
"
normalized_euclidean
"
]
<
epsilon
return
dis
[
"
submission_time
"
][
"
normalized_euclidean
"
]
<
epsilon
and
(
dis
[
"
starting_time
"
][
"
normalized_euclidean
"
]
<
epsilon
)
and
(
dis
[
"
finish_time
"
][
"
normalized_euclidean
"
]
<
epsilon
)
def
test_tt_only_multiuser
():
...
...
@@ -139,7 +140,7 @@ def test_tt_only_multiuser():
user_name
=
names
,
user_category
=
[
category
]
*
4
,
input_json
=
jsons
)
feedback_dir
=
run_user
(
category
,
mc_europar_platform
,
empty_workload
,
test_name
=
f
'
{
category
}
-
{
test_name
}
'
,
schedconf
=
schedconf_file
)
assert
_
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
assert
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
# mc_10_days_l60
test_name
=
"
mc_10days_l60
"
...
...
@@ -148,7 +149,7 @@ def test_tt_only_multiuser():
user_name
=
names
,
user_category
=
[
category
]
*
4
,
input_json
=
jsons
)
run_user
(
category
,
mc_europar_platform
,
empty_workload
,
test_name
=
f
'
{
category
}
-
{
test_name
}
'
,
schedconf
=
schedconf_file
)
assert
_
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
assert
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
# mc_10_days_m60
...
...
@@ -158,7 +159,53 @@ def test_tt_only_multiuser():
user_name
=
names
,
user_category
=
[
category
]
*
4
,
input_json
=
jsons
)
run_user
(
category
,
mc_europar_platform
,
empty_workload
,
test_name
=
f
'
{
category
}
-
{
test_name
}
'
,
schedconf
=
schedconf_file
)
assert_simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
assert
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
def
test_tt_only_multiuser_undersized_platform
():
"""
Same test than the previous one, but with an undersized plateform.
"""
names
=
[
"
user5
"
,
"
user9
"
,
"
user10
"
,
"
user11
"
]
# Launch a simulation with replay rigid, for comparison
category
=
"
replay_user_rigid
"
test_name
=
"
mc_10days
"
jsons
=
[
f
"
test/workloads/split_by_user/
{
user
}
.json
"
for
user
in
names
]
make_fb_user_description_file
(
user_name
=
names
,
user_category
=
[
category
]
*
4
,
input_json
=
jsons
)
rigid_dir
=
run_user
(
category
,
two_machine_platform
,
empty_workload
,
test_name
=
f
'
{
category
}
-
{
test_name
}
_undersized
'
,
schedconf
=
schedconf_file
)
# Launch feedback users on the same original log, and compare with rigid
category
=
"
fb_user_think_time_only
"
# mc_10_days_a60
test_name
=
"
mc_10days_a60
"
jsons
=
[
f
"
test/workloads/SABjson/
{
test_name
}
/
{
user
}
.SABjson
"
for
user
in
names
]
make_fb_user_description_file
(
user_name
=
names
,
user_category
=
[
category
]
*
4
,
input_json
=
jsons
)
feedback_dir
=
run_user
(
category
,
two_machine_platform
,
empty_workload
,
test_name
=
f
'
{
category
}
-
{
test_name
}
_undersized
'
,
schedconf
=
schedconf_file
)
assert
not
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
# mc_10_days_l60
test_name
=
"
mc_10days_l60
"
jsons
=
[
f
"
test/workloads/SABjson/
{
test_name
}
/
{
user
}
.SABjson
"
for
user
in
names
]
make_fb_user_description_file
(
user_name
=
names
,
user_category
=
[
category
]
*
4
,
input_json
=
jsons
)
run_user
(
category
,
two_machine_platform
,
empty_workload
,
test_name
=
f
'
{
category
}
-
{
test_name
}
_undersized
'
,
schedconf
=
schedconf_file
)
assert
not
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
# mc_10_days_m60
test_name
=
"
mc_10days_m60
"
jsons
=
[
f
"
test/workloads/SABjson/
{
test_name
}
/
{
user
}
.SABjson
"
for
user
in
names
]
make_fb_user_description_file
(
user_name
=
names
,
user_category
=
[
category
]
*
4
,
input_json
=
jsons
)
run_user
(
category
,
two_machine_platform
,
empty_workload
,
test_name
=
f
'
{
category
}
-
{
test_name
}
_undersized
'
,
schedconf
=
schedconf_file
)
assert
not
simu_output_are_close_enough
(
feedback_dir
,
rigid_dir
)
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