Commit 7d24b3d
authored
Reduce flake in Fleet installer tests (#6671)
## Summary of changes
Reduce the flake seen in Fleet installer tests
## Reason for change
The fleet installer tests are currently very flaky. This is mostly due
to the nightmare of trying to get the app to behave as it does elsewhere
(which _maybe_ we should just give up on, more on that later).
## Implementation details
The simple details are:
- Add a delay after running `ServiceMonitor.exe` before starting the app
pool and sending the initial request
- Add a hacky _completed.txt_ file to allow tracking when the app has
shutdown.
First, some history...
The design of the test app is that it starts, wait for itself to be
ready to handle requests, sends a self-request, and then shuts down.
This works great for Docker outside of IIS, because it means we know
that we get exactly one request, once the app is ready, and the docker
container exits once the sequence is complete. :chef-kiss:
On IIS, this just doesn't work. IIS does its best to make sure the app
_is_ always running. There's a bunch of other complexity. One of which
is the only way to get the app running in the first place is to send a
request to it, which messes with our snapshots (that's already handled).
But a bigger issue is the shutdown - I just can't find a way to "wait"
for it using the built-in behaviour. And without being able to wait for
shutdown, we don't know exactly when the "expected" request has been
sent.
So this has a hack - write to a file in the app when the app is shutting
down. And spin in the powershell script, waiting for that file to exist.
## Test coverage
I've run the tests repeatedly on this branch, and not seen any failures,
so 🤞
## Other details
Yeah, I know, the arbitrary delay could be a source of flake. I spent
_way_ too long trying to capture the output to explicitly wait for the
expected output, but no matter what sort of redirection I tried, I
couldn't capture it as I needed - it only writes to the redirected
output when the process ends, and the process _doesn't_ end 🙄 So yeah,
this is a hack, but it works1 parent 8c7974d commit 7d24b3d
File tree
2 files changed
+14
-4
lines changed- tracer
- build/_build/docker
- test/test-applications/regression/AspNetCoreSmokeTest
2 files changed
+14
-4
lines changedLines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| |||
0 commit comments