intermittent unit failure: DebugHooksServerSuite.TestRunHook

Bug #1749320 reported by Anastasia on 2018-02-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
John A Meinel
John A Meinel

Bug Description

As per

FAIL: server_test.go:150: DebugHooksServerSuite.TestRunHook


    s.verifyEnvshFile(c, envsh, hookName)


    c.Assert(contents, jc.Contains, fmt.Sprintf("JUJU_UNIT_NAME=%q", s.ctx.Unit))

... obtained string = ""

... expected string = "JUJU_UNIT_NAME=\"foo/8\""

OOPS: 4 passed, 1 FAILED

--- FAIL: TestPackage (0.04s)


FAIL 1.235s

John A Meinel (jameinel) wrote :
Changed in juju:
assignee: nobody → John A Meinel (jameinel)
John A Meinel (jameinel) wrote :

I'm able to reproduce this with this patch:
+(/bin/sleep 2 ; export) | grep -v $FILTER > $JUJU_DEBUG/

for some reason I don't understand:
(sleep 2; export)

*doesn't* trigger this, but /bin/sleep does.

I think the underlying race condition is that

blah > target

will create 'target' as soon as that line starts, but nothing actually gets written until 'blah' exits.

However, the test as written assumes that as soon as "stat" succeeds, that it can then read the contents of
We either want a loop that checks to see if is empty, or write to a temp file and rename into place.

John A Meinel (jameinel) wrote :
John A Meinel (jameinel) wrote :
Changed in juju:
milestone: none → 2.4-beta1
status: Triaged → In Progress
John A Meinel (jameinel) on 2018-02-28
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers