envoyproxy/envoy

[test] Remove use of temporary files in test environment

Open

#15.362 geöffnet am 8. März 2021

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.373 Forks)batch import
help wantedtech debt

Repository-Metriken

Stars
 (27.997 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (378 gemergte PRs in 30 T)

Beschreibung

Remove real temporary files in test environment

Description: Using real filesystems when running blaze test and creating temporary paths is non-hermetic. I've also seen a number of flakes in end to end fuzzers that extend BaseIntegrationTest and are failing on illegalPath, likely because of a space of other issue accessing the file. Ideally, running test binaries should not create files.

The major use of filepaths is using the bootstrap config path https://github.com/envoyproxy/envoy/blob/36e05482cc27b4d2b5765fdebcdb5fef16f07d84/test/integration/base_integration_test.cc#L191-L192 but there are also use cases for

  • File access logs, Tap paths, profile paths
  • xDS paths
  • Direct responses

The bootstrap config can be loaded via a string, but not all of the above use-cases have inline string replacements.

Perhaps we can instantiate a virtual filesystem in memory when running in certain modes/for certain tests. https://github.com/envoyproxy/envoy/blob/main/test/test_common/environment.h

See https://github.com/envoyproxy/envoy/pull/15318

Contributor Guide