Skip to content

Comments

Add tests and docs for reverse shell#998

Merged
KCarretto merged 3 commits intomainfrom
feature-reverse-shell-tests-docs
Nov 9, 2025
Merged

Add tests and docs for reverse shell#998
KCarretto merged 3 commits intomainfrom
feature-reverse-shell-tests-docs

Conversation

@google-labs-jules
Copy link
Contributor

This submission adds a comprehensive suite of tests for the reverse shell functionality, including unit tests for the stream package and a new end-to-end test that validates the entire communication flow from WebSocket to gRPC. It also includes a new "Reverse Shell Architecture" section in the developer guide and several bug fixes identified during testing.


PR created automatically by Jules for task 13001055127057653994

Adds a comprehensive suite of tests for the reverse shell functionality,
including unit tests for the `stream` package and a new end-to-end
test that validates the entire communication flow from WebSocket to gRPC.

Also includes:
- A new "Reverse Shell Architecture" section in the developer guide.
- Several bug fixes identified during testing, particularly around
  message ordering and race conditions in the `stream` and `c2` packages.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@KCarretto KCarretto self-requested a review November 9, 2025 05:14
@KCarretto KCarretto marked this pull request as ready for review November 9, 2025 05:51
@KCarretto KCarretto merged commit 1bce725 into main Nov 9, 2025
4 checks passed
@KCarretto KCarretto deleted the feature-reverse-shell-tests-docs branch November 9, 2025 05:53
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +76 to +92
// Unregister stream1
mux.Unregister(stream1)

// Give the mux a moment to unregister the stream
time.Sleep(10 * time.Millisecond)

// Send another message for stream1
err = topic.Send(ctx, &pubsub.Message{
Body: []byte("goodbye stream 1"),
Metadata: map[string]string{"id": "stream1"},
})
require.NoError(t, err)

// Assert stream1 does not receive the message
select {
case <-stream1.Messages():
t.Fatal("stream1 received message after being unregistered")

Choose a reason for hiding this comment

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

P1 Badge Avoid treating closed stream channel as received message

After calling mux.Unregister(stream1) the mux immediately closes the stream’s Messages() channel via Stream.Close(). The final select then reads from that closed channel and immediately enters the first branch, triggering t.Fatal even though no message was delivered. This makes the test fail deterministically once unregistration succeeds. The assertion should check the second return value from the receive or avoid reading a closed channel rather than assuming any receive implies a published message.

Useful? React with 👍 / 👎.

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.

1 participant