Tests require predictable map ordering
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
James Tunnicliffe |
Bug Description
In gccgo or newer go versions we can't assume that map ordering is fixed, which results in some new test failures, for example:
dooferlad@
-------
FAIL: service_test.go:49: serviceSuite.
service_test.go:64:
c.Check(cmd, gc.Equals, strings.
"el" + fmt.Sprintf(line, "/sbin/upstart", upstart),
"el" + fmt.Sprintf(line, "/sbin/systemd", systemd),
"el" + fmt.Sprintf(line, "/bin/systemd", systemd),
"el" + fmt.Sprintf(line, "/lib/systemd/
"else exit 1",
"fi",
}, "\n"))
... obtained string = "" +
... "if [[ \"$(cat /proc/1/cmdline)\" == \"/lib/
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/sbin/init\" ]]; then sudo initctl list | awk '{print $1}' | sort | uniq\n" +
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/sbin/upstart\" ]]; then sudo initctl list | awk '{print $1}' | sort | uniq\n" +
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/sbin/systemd\" ]]; then /bin/systemctl list-unit-files --no-legend --no-page -t service | grep -o -P '^\\w[\
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/bin/systemd\" ]]; then /bin/systemctl list-unit-files --no-legend --no-page -t service | grep -o -P '^\\w[\
... "else exit 1\n" +
... "fi"
... expected string = "" +
... "if [[ \"$(cat /proc/1/cmdline)\" == \"/sbin/init\" ]]; then sudo initctl list | awk '{print $1}' | sort | uniq\n" +
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/sbin/upstart\" ]]; then sudo initctl list | awk '{print $1}' | sort | uniq\n" +
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/sbin/systemd\" ]]; then /bin/systemctl list-unit-files --no-legend --no-page -t service | grep -o -P '^\\w[\
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/bin/systemd\" ]]; then /bin/systemctl list-unit-files --no-legend --no-page -t service | grep -o -P '^\\w[\
... "elif [[ \"$(cat /proc/1/cmdline)\" == \"/lib/
... "else exit 1\n" +
... "fi"
OOPS: 5 passed, 1 FAILED
--- FAIL: TestPackage (0.01s)
FAIL
exit status 1
FAIL github.
Changed in juju: | |
assignee: | nobody → James Tunnicliffe (dooferlad) |
affects: | juju → juju-core |
Changed in juju-core: | |
status: | New → In Progress |
tags: | added: ci regression test-failure |
Changed in juju-core: | |
importance: | Undecided → High |
milestone: | none → 1.23 |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
Changed in juju-core: | |
milestone: | 1.23 → 1.23-beta1 |
Fix proposed with http:// reviews. vapour. ws/r/1048/