Comments (7)
Is conn
closed?
Looks like it blocks on read() and I would expect read to return once the connection is closed.
from conmon-rs.
On a second look not conn must be closed but rather cfg.Streams.Stdin
since we read from there.
from conmon-rs.
@Luap99 yeah we also block on read in the tests, but I see that as not critical:
conmon-rs/pkg/client/suite_test.go
Lines 379 to 396 in cc1ea23
Do you consider working on a fix for that?
from conmon-rs.
I assume cfg.Streams.Stdin
is supposed to be closed by the caller, i.e. the test here?
Also the goroutines in the ginkgo tests need a defer GinkgoRecover()
at the top in order to work properly, https://onsi.github.io/ginkgo/#mental-model-how-ginkgo-handles-failure
from conmon-rs.
I know next to nothing about the conmon-rs internal but the test is not working.
change the testAttach function to in order to actually make sure it is executed:
func testAttach(stdinWrite io.Writer, stdoutRead, stderrRead io.Reader) {
wg := &sync.WaitGroup{}
wg.Add(3)
// Stdin
stdoutBuf := bufio.NewReader(stdoutRead)
stderrBuf := bufio.NewReader(stderrRead)
go func() {
defer GinkgoRecover()
defer wg.Done()
_, err := fmt.Fprintf(stdinWrite, "/busybox echo Hello world\r")
Expect(err).To(BeNil())
_, err = fmt.Fprintf(stdinWrite, "/busybox echo Hello world >&2\r\n")
Expect(err).To(BeNil())
fmt.Println("stdin done")
}()
go func() {
defer GinkgoRecover()
defer wg.Done()
// Stdout test
line, err := stdoutBuf.ReadString('\n')
Expect(err).To(BeNil())
fmt.Println(line)
Expect(line).To(ContainSubstring("Hello world"))
fmt.Println("stdout done")
}()
go func() {
defer GinkgoRecover()
defer wg.Done()
line, err := stderrBuf.ReadString('\n')
Expect(err).To(BeNil())
fmt.Println(line)
Expect(line).To(ContainSubstring("Hello world"))
fmt.Println("stderr done")
}()
wg.Wait()
}
There seems to be at least two problems that I can see:
- the terminal test cannot work with both stdour/err since a terminal only uses one stream.
It is failing with and just hangs.
2022-07-21T14:47:14.725434Z ERROR backend:create_container{container_id="7b5d1daad76b330d663e0cb73524170cff34f98a5a4c417ac4455126f5be6927" uuid="17e3bede-4368-4a3e-a2cf-a63e9d39d137"}:listen:read_loop: conmon::terminal: 210: Stdout read loop failure: write to attach endpoints: write to attach endpoint: Broken pipe (os error 32)
- The test without terminal read the input but never sends any output back and therefore also hangs
from conmon-rs.
@Luap99 thank you for the investigations here. I think we can split-up the tests to test the terminal / non terminal cases in a more separated fashion.
from conmon-rs.
I think the tests are still broken, even with #579. I have to dig more into that.
from conmon-rs.
Related Issues (20)
- Add support for unsharing user namespaces HOT 2
- PAUSE_PATH should be configurable HOT 2
- pause process should only be started if pid namespace is specified HOT 5
- conmon-rs always opens a namespace, even if it won't be used HOT 4
- packit enablement for conmon-rs HOT 2
- Add support for additional log drivers HOT 14
- Finalize podman support in conmon-rs HOT 13
- [rhcontainerbot/podman-next copr] conmon-rs builds have the same release tag HOT 5
- Update rust version HOT 3
- `main` branch builds on epel 8/9 failing HOT 8
- Go Client: client.AttachConfig has ExecSession field but no way to get it HOT 1
- Add NOTIFY_SOCKET to get notify from runc
- client/server compatbility tests HOT 1
- Packit package builds are broken HOT 2
- Update capnproto to v0.19.0 HOT 2
- Expose number of containers attached to a conmon-rs process HOT 5
- Packit: EPEL 8 builds are failling consistently
- switch conmon-rs.spec.rpkg to conmon-rs.spec HOT 2
- Failed to start the crio service with error meaasge: " parse conmon version: No Major.Minor.Patch elements found"
- Pod cannot be deleted due to missing container startup command HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conmon-rs.