Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

role-reapers test flake #11024

Closed
bparees opened this issue Sep 20, 2016 · 8 comments
Closed

role-reapers test flake #11024

bparees opened this issue Sep 20, 2016 · 8 comments
Assignees
Labels
component/auth kind/test-flake Categorizes issue or PR as related to test flakes. priority/P2

Comments

@bparees
Copy link
Contributor

bparees commented Sep 20, 2016

In suite "github.com/openshift/origin/test/cmd/admin/role-reapers", test case "test/cmd/admin.sh:250: executing 'oc process -f test/extended/testdata/roles/policy-roles.yaml -v NAMESPACE='cmd-admin' | oc create -f -' expecting success" failed:
=== BEGIN TEST CASE ===
test/cmd/admin.sh:250: executing 'oc process -f test/extended/testdata/roles/policy-roles.yaml -v NAMESPACE='cmd-admin' | oc create -f -' expecting success
FAILURE after 1.266s: test/cmd/admin.sh:250: executing 'oc process -f test/extended/testdata/roles/policy-roles.yaml -v NAMESPACE='cmd-admin' | oc create -f -' expecting success: the command returned the wrong error code
Standard output from the command:
role "basic-user" created
policybinding "cmd-admin:default" created

Standard error from the command:
Error from server: role "basic-user" not found
=== END TEST CASE ===

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_check/6108/console

@liggitt
Copy link
Contributor

liggitt commented Sep 26, 2016

@deads2k I thought we did live lookups here (at least until @smarterclayton's change goes in)

@deads2k
Copy link
Contributor

deads2k commented Sep 26, 2016

@deads2k I thought we did live lookups here (at least until @smarterclayton's change goes in)

Yep. Not sure how it missed.

@liggitt
Copy link
Contributor

liggitt commented Sep 26, 2016

then I am confused

@enj
Copy link
Contributor

enj commented Oct 12, 2016

Not really sure where to dig for this... The only recent change I see is from f.Object + f.ClientForMapping to f.UnstructuredObject + f.UnstructuredClientForMapping.

commit 74552466e64a1321191ad5862485dbbee751369e
Author: Clayton Coleman <ccoleman@redhat.com>
Date:   Thu Sep 1 12:17:46 2016 -0400

    bump(k8s.io/kubernetes):d19513fe86f3e0769dd5c4674c093a88a5adb8b4

diff --git a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/create.go b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/create.go
--- a/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/create.go
+++ b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/create.go
@@ -94,61 +100,64 @@
 func RunCreate(f *cmdutil.Factory, cmd *cobra.Command, out io.Writer, options *CreateOptions) error {
    schema, err := f.Validator(cmdutil.GetFlagBool(cmd, "validate"), cmdutil.GetFlagString(cmd, "schema-cache-dir"))
    if err != nil {
        return err
    }

    cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
    if err != nil {
        return err
    }

-   mapper, typer := f.Object(cmdutil.GetIncludeThirdPartyAPIs(cmd))
-   r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.ClientForMapping), f.Decoder(true)).
+   mapper, typer, err := f.UnstructuredObject()
+   if err != nil {
+       return err
+   }
+   r := resource.NewBuilder(mapper, typer, resource.ClientMapperFunc(f.UnstructuredClientForMapping), runtime.UnstructuredJSONScheme).
        Schema(schema).
        ContinueOnError().
        NamespaceParam(cmdNamespace).DefaultNamespace().
        FilenameParam(enforceNamespace, options.Recursive, options.Filenames...).
        Flatten().
        Do()
    err = r.Err()
    if err != nil {
        return err
    }

    count := 0
    err = r.Visit(func(info *resource.Info, err error) error {
        if err != nil {
            return err
        }
        if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), info, f.JSONEncoder()); err != nil {
            return cmdutil.AddSourceToErr("creating", info.Source, err)
        }

        if cmdutil.ShouldRecord(cmd, info) {
            if err := cmdutil.RecordChangeCause(info.Object, f.Command()); err != nil {
                return cmdutil.AddSourceToErr("creating", info.Source, err)
            }
        }

        if err := createAndRefresh(info); err != nil {
            return cmdutil.AddSourceToErr("creating", info.Source, err)
        }

        count++
        shortOutput := cmdutil.GetFlagString(cmd, "output") == "name"
        if !shortOutput {
            f.PrintObjectSpecificMessage(info.Object, out)
        }
        cmdutil.PrintSuccess(mapper, shortOutput, out, info.Mapping.Resource, info.Name, "created")
        return nil
    })
    if err != nil {
        return err
    }
    if count == 0 {
        return fmt.Errorf("no objects passed to create")
    }
    return nil
 }

 // createAndRefresh creates an object from input info and refreshes info with that object

@enj
Copy link
Contributor

enj commented Oct 13, 2016

@smarterclayton Is this related to #11028?

Edit: Hm I suppose that is not possible since this flake was recorded before you merged your PR.

@smarterclayton
Copy link
Contributor

Yeah I also invented time travel but I erased the evidence, except for this flake. But I still have plenty of time to fix it.

@enj
Copy link
Contributor

enj commented Oct 27, 2016

Update: I have reproduced this locally but even with client / server logs set at 100 I have seen nothing of note. Not sure where to look next.

@stevekuznetsov
Copy link
Contributor

Seen this again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/auth kind/test-flake Categorizes issue or PR as related to test flakes. priority/P2
Projects
None yet
Development

No branches or pull requests

7 participants