Skip to content

[TESTS] Add global random seed for deterministic test#525

Merged
ogajduse merged 4 commits intoRedHatQE:masterfrom
Stephen0512:master
Apr 22, 2026
Merged

[TESTS] Add global random seed for deterministic test#525
ogajduse merged 4 commits intoRedHatQE:masterfrom
Stephen0512:master

Conversation

@Stephen0512
Copy link
Copy Markdown
Contributor

Description

This PR sets a fixed global random seed after imports in the test file to ensure deterministic and reproducible test behavior.

Motivation

Some tests rely on randomness without a fixed seed, which can lead to flaky tests, inconsistent CI results, and difficulty reproducing failures.

Change

A global random seed is initialized to make random behavior consistent across test runs.

Benefits

  • More reproducible and reliable tests
  • Easier debugging of failures
  • Consistent CI behavior

The issue was identified during an ongoing research project.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to make tests/test_hawkular.py deterministic by fixing the randomness source so that sampling-based test setup is reproducible across runs.

Changes:

  • Imports seed from Python’s random module.
  • Seeds the global RNG (seed(17)) at module import time.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_hawkular.py Outdated
@ogajduse
Copy link
Copy Markdown
Member

Thank you for your contribution, @Stephen0512!

@ogajduse ogajduse merged commit 8254a0d into RedHatQE:master Apr 22, 2026
4 checks passed
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.

3 participants