Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bliss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Alisher Gaibulaev
bliss
Commits
484bc499
Commit
484bc499
authored
2 years ago
by
Wout De Nolf
Browse files
Options
Downloads
Patches
Plain Diff
timescan writer test: takes much longer for a timescan to
progress on CI than before. Reduce the number of detectors.
parent
b2f5b4d0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/nexus_writer/test_nxw_timescan.py
+16
-7
16 additions, 7 deletions
tests/nexus_writer/test_nxw_timescan.py
with
16 additions
and
7 deletions
tests/nexus_writer/test_nxw_timescan.py
+
16
−
7
View file @
484bc499
...
...
@@ -5,6 +5,7 @@
# Copyright (c) 2015-2022 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
import
time
import
gevent
import
pytest
from
bliss.common
import
scans
...
...
@@ -44,12 +45,13 @@ def test_nxw_timescan_base_nopolicy(nexus_writer_base_nopolicy):
@nxw_test_utils.writer_stdout_on_exception
def
_test_nxw_timescan
(
session
=
None
,
tmpdir
=
None
,
writer
=
None
,
**
kwargs
):
nodes
=
{}
nodes
=
dict
()
started
=
gevent
.
event
.
Event
()
nminevents
=
5
detectors
=
[
"
diode3
"
,
"
simu1
"
,
"
lima_simulator
"
]
session
.
env_dict
[
"
simu1
"
].
block_size
=
1
session
.
env_dict
[
"
simu2
"
].
block_size
=
1
scan_detectors
=
[
session
.
env_dict
[
d
]
for
d
in
detectors
]
scan_detectors
.
append
(
session
.
env_dict
[
"
lima_simulator
"
].
bpm
)
def
listenscan
(
scannode
):
print
(
f
"
Listen to scan
{
scannode
.
db_name
}
"
)
...
...
@@ -78,16 +80,17 @@ def _test_nxw_timescan(session=None, tmpdir=None, writer=None, **kwargs):
g
.
kill
()
glisten
=
gevent
.
spawn
(
listensession
)
scan
=
scans
.
timescan
(
0.1
,
run
=
False
)
scan
=
scans
.
timescan
(
0.1
,
*
scan_detectors
,
run
=
False
)
gscan
=
nxw_test_utils
.
run_scan
(
scan
,
runasync
=
True
)
try
:
with
gevent
.
Timeout
(
30
)
as
total_timeout
:
# Wait until first channel has data
print
(
"
Wait for the first NEW_DATA event ...
"
)
t0
=
time
.
time
()
started
.
wait
()
# Wait until all channels have nmin data events
while
any
(
v
<
=
nminevents
for
v
in
nodes
.
values
()):
while
any
(
v
<
nminevents
for
v
in
nodes
.
values
()):
lst
=
set
(
nodes
.
values
())
nmin
=
min
(
lst
)
nmax
=
max
(
lst
)
...
...
@@ -104,7 +107,9 @@ def _test_nxw_timescan(session=None, tmpdir=None, writer=None, **kwargs):
continue
else
:
raise
RuntimeError
(
"
Scan stopped without exception
"
)
print
(
f
"
All
{
len
(
nodes
)
}
channels have at least
{
nminevents
}
data events.
"
)
print
(
f
"
All
{
len
(
nodes
)
}
channels have at least
{
nminevents
}
data events (took
{
time
.
time
()
-
t0
:
.
02
f
}
seconds).
"
)
finally
:
try
:
# Stop scan and listener
...
...
@@ -126,5 +131,9 @@ def _test_nxw_timescan(session=None, tmpdir=None, writer=None, **kwargs):
print
(
"
Verify data ...
"
)
nxw_test_utils
.
wait_scan_data_finished
([
scan
],
writer
=
writer
)
nxw_test_data
.
assert_scan_data
(
scan
,
scan_shape
=
(
0
,),
positioners
=
[[
"
elapsed_time
"
,
"
epoch
"
]],
**
kwargs
scan
,
scan_shape
=
(
0
,),
positioners
=
[[
"
elapsed_time
"
,
"
epoch
"
]],
detectors
=
detectors
,
**
kwargs
,
)
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