windows: uniter tests fail because logs get dumped to stderr

Bug #1576313 reported by Bogdan Teleaga
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Critical
Bogdan Teleaga
juju-ci-tools
Invalid
High
Unassigned

Bug Description

As seen here http://data.vapour.ws/juju-ci/products/version-3930/run-unit-tests-win2012-amd64-go1_6/build-48/consoleText

Exactly,
    c.Check(string(result.Stderr), gc.Equals, "")
... obtained string = "" +
... "2016-04-27 18:47:50 WARNING utils.featureflag flags_windows.go:34 Failed to open juju registry key HKLM:\\SOFTWARE\\juju-core; feature flags not enabled\n" +
... "2016-04-27 18:47:50 WARNING utils.featureflag flags_windows.go:34 Failed to open juju registry key HKLM:\\SOFTWARE\\juju-core; feature flags not enabled\n"
... expected string = ""

Looks like we're running the jujud binary, which is looking for registry keys, because that's how it reads the feature flags.
After looking around for a bit I found a logToStderr flag that the agents have, but it doesn't look like it's getting set at all here.

Revision history for this message
Martin Packman (gz) wrote :

Looks like bug 1470601 again basically?

tags: added: ci regression test-failure windows
Changed in juju-core:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Bogdan Teleaga (bteleaga) wrote :

Yes, it seems to be the same one. That one was fixed here https://github.com/juju/juju/commit/8ff118b17bcb0a0b491806e6606ed482a601edce

Then reverted here https://github.com/juju/juju/commit/cb9cf61b026c314b2ea66d6877cbae461071a72e

But it looks like at least the registry key stuck around on the machine running the tests so the warning did not come up anymore.

Revision history for this message
Cheryl Jennings (cherylj) wrote :

This is causing failures in CI.

tags: added: blocker
Martin Packman (gz)
Changed in juju-core:
importance: High → Critical
Changed in juju-core:
milestone: none → 2.0-beta7
Changed in juju-core:
assignee: nobody → Horacio Durán (hduran-8)
Changed in juju-core:
status: Triaged → In Progress
Revision history for this message
Horacio Durán (hduran-8) wrote :

Bogdan is right, support for env variables must be built for windows to use during tests, ill write a fallback to env variables when no key present

Revision history for this message
Horacio Durán (hduran-8) wrote :

I had a conversation with Bogdan and reviewed the previous patches related to it, here is my conclusion (based on my understanding of windows shell and environment).
* For jujud running as a service, we cannot provide a shell env with variables set and, if we could, it would be as shared as the registry keys.
* For testing, there might be a way to set variables, but they apparently will have the same effect that when using jujud as a service, the vars would be shared.
* The error, is not an error, its a log warning that windows is not properly re-directing.

The simplest/best solution for the current issue is to set the blank var in CI windows and Open a bug to actually refactor the part of the code that calls jujud as is (there is a comment by william in the relevant part of the code stating his outrage about that) where we either do proper windows redirection of outputs or find a better way to have a working jujud.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Before running unit-tests on a windows host. HKLM:\\SOFTWARE\\juju-core must be set blank. This can be done before running the script or the script can have an option to do it itself.

Changed in juju-ci-tools:
status: New → Triaged
importance: Undecided → High
Changed in juju-core:
status: In Progress → Won't Fix
Revision history for this message
Curtis Hovey (sinzui) wrote :

We are re opening this issue. The juju test suite needs to setup a fake reg or manage the real reg because different tests have different expectations about what the reg contains. We learned from experimentation that some tests care about the content of the registry.
    UniterSuite.TestRunCommand
    UniterSuite.TestLeadership

Changed in juju-core:
status: Won't Fix → Triaged
Curtis Hovey (sinzui)
tags: removed: blocker
Curtis Hovey (sinzui)
Changed in juju-core:
milestone: 2.0-beta7 → 2.0-beta8
Revision history for this message
Bogdan Teleaga (bteleaga) wrote :
Changed in juju-core:
assignee: Horacio Durán (hduran-8) → Bogdan Teleaga (bteleaga)
Changed in juju-core:
status: Triaged → In Progress
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in juju-ci-tools:
status: Triaged → Invalid
affects: juju-core → juju
Changed in juju:
milestone: 2.0-beta8 → none
milestone: none → 2.0-beta8
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.