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

Reorganize dummy downstairs tests #1253

Merged
merged 10 commits into from
Apr 10, 2024

Conversation

mkeeter
Copy link
Contributor

@mkeeter mkeeter commented Apr 9, 2024

This is more prep for addressing #1252

Previously, our live-repair tests were checking two different things in a single test:

  • Sending 57K jobs caused a Downstairs to be marked as faulted
  • Once faulted, various live-repair operations occurred

There's also a separate test, test_byte_fault_condition (#1192), to confirm that sending > 1 GiB caused a Downstairs to be marked as faulted.

This PR splits those two checks into separate unit tests, adding new (test-only) APIs to (1) check Downstairs state and (2) manually fault a Downstairs. We want these checks to be separate because – once we make the changes for #1252 – sending 57K jobs will no longer cause an active downstairs to be marked as faulted.

In addition, common TestHarness code is consolidated into helper functions:

  • Clone the Guest and tokio::spawnTestHarness::spawn
  • Expect a particular message type and reply to it →DownstairsHandle::ack_read, ack_write, ack_flush

@mkeeter mkeeter requested review from jmpesp and leftwo April 9, 2024 19:15
Comment on lines 2147 to 2148
// TODO is this correct? Shouldn't values in the mpsc queue be read out,
// even if the sender has been dropped?
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think our ClientIoTask drains the requests before stopping: a quick glace at client.rs and it looks like landing in a self.stop branch breaks out of the task?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, I forgot that the ClientIoTask drops values while exiting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(removed the comment in a64ce0c)

@@ -2342,6 +2342,10 @@ pub(crate) enum ClientStopReason {

/// The upstairs has requested that we deactivate
Deactivated,

/// The test suite has requested a fault
#[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know how it would work, but it might be nice to have a way to expose this interface
as a build option? We could write various tests that would trigger a fault during specific
times. I suppose it's not much different than just stopping or pstopping a downstairs process
which is our go to method now.

"could not send read response for job {} = {}: {}",
i,
job_id,
"could not send read response for job {}: {}",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an expected situation, right? If so, we might want to change the log message to indicate it is expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, done in 1cc5719

@mkeeter mkeeter force-pushed the reorganize-dummy-ds-tests branch from a64ce0c to 1cc5719 Compare April 10, 2024 20:18
@mkeeter mkeeter merged commit df5391a into oxidecomputer:main Apr 10, 2024
18 checks passed
@mkeeter mkeeter deleted the reorganize-dummy-ds-tests branch April 10, 2024 21:19
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