Skip to content

more fixes for orchestrator script#81

Open
rostalan wants to merge 2 commits intoredhat-developer:mainfrom
rostalan:install-orch-fix
Open

more fixes for orchestrator script#81
rostalan wants to merge 2 commits intoredhat-developer:mainfrom
rostalan:install-orch-fix

Conversation

@rostalan
Copy link
Copy Markdown
Contributor

@rostalan rostalan commented Apr 9, 2026

  • replaced check_operator_status with wait_for_operator using OLM label selectors for deterministic operator selection
  • handle 409 race in createNamespaceIfNotExists

…hecks

- Handle 409 conflict race in createNamespaceIfNotExists
- Restore startingCSV pinning and use OLM labels for operator status checks
- Add prepack script to build dist for git deps
- Bump to 1.1.29

Made-with: Cursor
createError.message.includes("409")
) {
console.log(`✓ Namespace ${namespace} already exists`);
return await this._k8sApi.readNamespace({ name: namespace });
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 409 handling itself looks fine as a defensive measure, but I'm not sure the race condition scenario described actually happens in practice. createNamespaceIfNotExists already does a read-before-create, and the callers within this package don't seem to race configure() and deploy() run sequentially. Different Playwright workers get different project names so they'd be creating different namespaces too.

Can you share what failure you actually hit that led to this? If it was a flaky CI run, it might have been something else (retry after timeout, namespace stuck in Terminating, etc.) rather than a true parallel create race.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original logs expired, but it was a real CI failure on PR #2052 (2026-04-08T12:34:12Z). The orchestrator workspace has one project with two spec files, but playwright runs them on 2 separate workers. Both workers initialize concurrently, each calls the createNamespaceIfNotExists("orchestrator"), however then there is a race and the the slower worker fails with 409:

Running 52 tests using 2 workers
✓ Created namespace orchestrator
✗ Failed to create namespace orchestrator: HTTP-Code: 409
Error: HTTP-Code: 409
Body: {"status":"Failure","message":"namespaces \"orchestrator\" already exists",
       "reason":"AlreadyExists","code":409}
    at CoreV1ApiResponseProcessor.createNamespaceWithHttpInfo
    at KubernetesClientHelper.createNamespaceIfNotExists
    at RHDHDeployment.configure

Will try to find the full log in cursor convo...

Copy link
Copy Markdown
Contributor Author

@rostalan rostalan Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relevant section:

Global setup completed successfully
Running 52 tests using 2 workers
✓ Created namespace orchestrator
✗ Failed to create namespace orchestrator: HTTP-Code: 409
Message: Unknown API Status Code!
Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"namespaces \\\"orchestrator\\\" already exists\",\"reason\":\"AlreadyExists\",\"details\":{\"name\":\"orchestrator\",\"kind\":\"namespaces\"},\"code\":409}\n"
Headers: {"audit-id":"4844d4df-0a1d-41cd-9240-872f6fac29f1","cache-control":"no-cache, private","connection":"close","content-length":"214","content-type":"application/json","date":"Wed, 08 Apr 2026 13:05:50 GMT","strict-transport-security":"max-age=31536000; includeSubDomains; preload","x-kubernetes-pf-flowschema-uid":"c2e2b597-a15c-475b-b2e8-882bbf41352d","x-kubernetes-pf-prioritylevel-uid":"1edd6b33-5208-4fd1-8533-25509e5145b4"}

Copy link
Copy Markdown
Member

@subhashkhileri subhashkhileri Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The orchestrator workspace has one project with two spec files

that's the issue. and its expected if you use rhdh fixture then a project should have single spec file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

@rostalan rostalan Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so if that pattern is to be followed, I either have to merge the two spec files (which would result in a 2500 line spec file) or move them to separate pw projects, which would increase the setup time...

Copy link
Copy Markdown
Member

@subhashkhileri subhashkhileri Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so both spec file depends on same deployment?
in that case we have two option as you already understood.

  1. merge both spec file. (downside - will increase line of code in single file)
  2. have two sepearte projects (downside - although projects run parallel but still could take a little more time and consume more resource)

I guess, its upto you to make a educated call and choose one option to align with the other workspace and our overlay testing framework.

IMO, for the option 1 other than increasing line of code in single file i don't see any other issue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another option which i havenot realy tested but just sharing thoughts, what if we have parent spec and import the other spects into it?

Copy link
Copy Markdown
Member

@subhashkhileri subhashkhileri Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so I tested last option and it works, which means we can have one project and one spec and import others into it.
let me know if you require more context/help, we can even have quick call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look on monday, thanks for the suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants