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

nixos/tests: fix flaky cntr test #162582

Merged
merged 1 commit into from
Mar 3, 2022
Merged

nixos/tests: fix flaky cntr test #162582

merged 1 commit into from
Mar 3, 2022

Conversation

JJJollyjim
Copy link
Member

@JJJollyjim JJJollyjim commented Mar 3, 2022

Motivation for this change

The cntr test sometimes hangs until the 10-hour hydra limit – this is currently the sole thing stopping trunk-combined from advancing.

Things done

This behaviour appears to be an edge-case related to the type of TTY in which the cntr command runs during test execution. We can work around this by running the command as a background job.

I additionally added a wait_for_open_port to fix nondeterministic test failures I observed after fixing the hanging issue.

!ofborg test cntr

@JJJollyjim
Copy link
Member Author

Force-pushed since I left some debugging tools in

!ofborg test cntr

The cntr sometimes hangs until the 10-hour hydra limit. This behaviour
appears to be an edge-case related to the type of TTY in which the cntr
command runs during test execution. We can work around this by running
the command as a background job.

I additionally added a wait_for_open_port to fix nondeterministic test
failures I observed after fixing the hanging issue.
@JJJollyjim
Copy link
Member Author

… and again with the trailing whitespace removed :)

!ofborg test cntr

@JJJollyjim JJJollyjim added the 1.severity: channel blocker Blocks a channel label Mar 3, 2022
@zowoq
Copy link
Contributor

zowoq commented Mar 3, 2022

this is currently the sole thing stopping trunk-combined from advancing.

cntr test isn't a channel blocker?

@zowoq
Copy link
Contributor

zowoq commented Mar 3, 2022

Needs to be @ not ! .

@ofborg test cntr

@JJJollyjim
Copy link
Member Author

cntr test isn't a channel blocker?

Ah I guess not by the standard definition. It "blocks" the channel from advancing for 10 hours while we wait for it to time out, but it no, it's not a blocker blocker.

@zowoq
Copy link
Contributor

zowoq commented Mar 3, 2022

ofborg doesn't seem to like cntr

@ofborg test cntr.docker cntr.nixos-container cntr.podman

"cntr attach -t ${backend} nginx sh -- -c 'curl localhost | grep Hello'"
${backend}.wait_for_open_port(8181)
# For some reason, the cntr command hangs when run without the &.
# As such, we have to do some messy things to ensure we check the exitcode and output in a race-condition-safe manner
Copy link
Member

Choose a reason for hiding this comment

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

This seems weird. Maybe something with the terminal changed in our nixos tests?
Can you also open up an issue in cntr itself? Should be fine to merge this though in the meantime.

@Mic92 Mic92 merged commit d34f708 into NixOS:master Mar 3, 2022
@Mic92
Copy link
Member

Mic92 commented Mar 3, 2022

tested locally.

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

Successfully merging this pull request may close these issues.

None yet

4 participants