Skip to content

Conversation

aaronlew02
Copy link
Collaborator

@aaronlew02 aaronlew02 commented Aug 8, 2025

Summary

This change speeds up TUF conformance testing by using an HTTP server.

@aaronlew02 aaronlew02 force-pushed the tuf-conformance-server branch 2 times, most recently from 52c7a19 to e109a4e Compare August 8, 2025 23:26
@aaronlew02 aaronlew02 force-pushed the tuf-conformance-server branch 2 times, most recently from 30ed39b to 981e60a Compare August 27, 2025 18:39
@jku
Copy link
Member

jku commented Aug 29, 2025

btw, is it possible to increase the verbosity of the client code somehow? Doesn't have to be a CLI flag or anything if that's complicated, a code change is fine, but would be useful to be able to see a little more of the client decisions...

@loosebazooka
Copy link
Member

We don't really have much logging. But what are you looking for?

@jku
Copy link
Member

jku commented Aug 29, 2025

We don't really have much logging. But what are you looking for?

was just interested to see what sort of decisions the client is making in general -- e.g. was interested in test_snapshot_rollback[basic] but since the refresh succeeds, there's nothing in the output (like which metadata versions it successfully loads)

but if there's no logging like that then I know I'll have have to add some if I really want to know.

@jku
Copy link
Member

jku commented Aug 29, 2025

there is some issue with the stream redirection:

  • it all works great the first time tuf-cli-server sends a request and processes a response...
  • further tuf-cli-server invocations will not get the expected output in the json response (whether in the same test or another test)
  • exception stack trace still ends up in the jsonResponse somehow

What I imagine might happen (caveat: I barely read java):

  • I have added logging call in Updater.java: this works once after tuf-cli-server-all.jar server is started (the log line goes all the way to tuf-conformance output). After that it never works again
  • the Updater logger is a class variable so is created when the class is first instantiated: at this point the stream is the correct stream for this test invocation
  • when a new Updater is instantiated, the logger stderr uses the old stream and not the stream that would end up in the new jsonResponse

This might not be important enough to fix considering what Appu said -- there's not much logging in the code.

@loosebazooka
Copy link
Member

yeah I think we could run the server in a mode which tees the output to stdout/err as well as returning it to the conformance suite. So if someone happened to be testing locally running the server in a different terminal than the tests, then we'd be okay.

@aaronlew02 aaronlew02 force-pushed the tuf-conformance-server branch from 7a6046b to 93f902f Compare August 29, 2025 17:49
@aaronlew02 aaronlew02 changed the title WIP: Use HTTP server for TUF conformance testing Use HTTP server for TUF conformance testing Aug 29, 2025
@aaronlew02 aaronlew02 marked this pull request as ready for review August 29, 2025 17:56

import java.time.Clock;

public class TestClock {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not super fond of the idea of a global test clock. I think this should be instantiable . And we can modify the cli to accept a "time" with a --time flag.

@@ -1,4 +1,6 @@
name: TUF Conformance Tests
permissions:
contents: read
Copy link
Member

Choose a reason for hiding this comment

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

was this not working before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not having this set triggered a GitHub security warning for #1038.

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