plainbox crashes if duplicate test case names are present in the jobs files

Bug #1157264 reported by Sean Feole
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Medium
Zygmunt Krynicki

Bug Description

Checkbox Build: Installed: 0.15.5+bzr1993+201303181119~quantal1
Plainbox Build: Installed: 0.2+bzr1993+bzr4~quantal1

Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal

Summary:

In the output below, I am attempting to run plainbox against the cpu testcase "cpu/scaling_test" which is located in /usr/share/checkbox/jobs/cpu.txt

In most cases, plainbox will run against any of the test cases by default in /usr/share/checkbox/jobs. I have found that if custom test cases are added and have a "duplicate" test case name that this error will occur below: See attached test.txt file and note the test case "keys/volume". This test case is already present in "/usr/share/checkbox/jobs/keys.txt"

I spoke with Zyga who mentioned there should be code in plainbox to identify duplicate test cases and handle them properly. Filing a bug as requested by Zyga.

sfeole@sfmadmax:/usr/share/checkbox/jobs$ plainbox run -i 'cpu/scaling_test'
===============================[ Analyzing Jobs ]===============================
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/plainbox/impl/session.py", line 440, in update_desired_job_list
    self._job_list, self._desired_job_list)
  File "/usr/lib/python3/dist-packages/plainbox/impl/depmgr.py", line 163, in resolve_dependencies
    return cls(job_list)._solve(visit_list)
  File "/usr/lib/python3/dist-packages/plainbox/impl/depmgr.py", line 172, in __init__
    self._job_map = self._get_job_map(job_list)
  File "/usr/lib/python3/dist-packages/plainbox/impl/depmgr.py", line 261, in _get_job_map
    raise DependencyDuplicateError(job_map[job.name], job)
plainbox.impl.depmgr.DependencyDuplicateError: duplicate job name: 'keys/volume'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/plainbox", line 9, in <module>
    load_entry_point('plainbox==0.2', 'console_scripts', 'plainbox')()
  File "/usr/lib/python3/dist-packages/plainbox/impl/__init__.py", line 82, in call_impl
    return impl(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/plainbox/impl/box.py", line 112, in main
    retval = box.main(argv)
  File "/usr/lib/python3/dist-packages/plainbox/impl/box.py", line 82, in main
    return ns.command.invoked(ns)
  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/run.py", line 58, in invoked
    return self._run_jobs(ns, job_list, exporter)
  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/run.py", line 137, in _run_jobs
    self._update_desired_job_list(session, matching_job_list)
  File "/usr/lib/python3/dist-packages/plainbox/impl/commands/run.py", line 174, in _update_desired_job_list
    problem_list = session.update_desired_job_list(desired_job_list)
  File "/usr/lib/python3/dist-packages/plainbox/impl/session.py", line 444, in update_desired_job_list
    self._desired_job_list.remove(exc.affected_job)
ValueError: list.remove(x): x not in list

--------------------------------------------------------------------------------------------------------------

To Reproduce:

1: Install Checkbox & Plainbox
2: Download the test.txt job file from this bug and place in "/usr/share/checkbox/jobs/"
3: Run plainbox with: plainbox run -i 'cpu/scaling_test'
4: Observe Error

Tags: plainbox

Related branches

Revision history for this message
Sean Feole (sfeole) wrote :
Changed in checkbox:
status: New → Confirmed
Revision history for this message
Sean Feole (sfeole) wrote :

Marking confirmed since Zyga was able to reproduce with me on IRC

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is caused by SessionState.__init__() being naive to get correct input. It does not affect our current releases unless our jobs are borked and they are not. Still this is pretty annoying at such a core component. Fixing in: https://code.launchpad.net/~zkrynicki/checkbox/fix-session-init/+merge/154140

Changed in checkbox:
assignee: nobody → Zygmunt Krynicki (zkrynicki)
importance: Undecided → Medium
status: Confirmed → In Progress
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Fix is now being reviewed.

For reference, this is how it looks like with the same data right now:

vagrant@vagrant-ubuntu-raring-32:/usr/share/checkbox/jobs$ plainbox run -i cpu/scaling_test
===============================[ Analyzing Jobs ]===============================
The job database you are currently using is broken
At least two jobs contend for the name keys/volume
First job defined in: /usr/share/checkbox/jobs/test.txt:1-9
Second job defined in: /usr/share/checkbox/jobs/keys.txt:12-26
duplicate job name: 'keys/volume'

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I've marked this as released, our daily ppa will have that with the next build. Since plainbox has no other releases that seems appropriate

Changed in checkbox:
status: In Progress → Fix Released
Revision history for this message
Sean Feole (sfeole) wrote :

Thanks Zyga, fix verified on my systems as well!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.