1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
Commit graph

23 commits

Author SHA1 Message Date
MSP-Greg
b7748849b4
Try to fix intermittent CI issues (#2739)
* TestIntegrationSingle#test_closed_listener - fix on older OSX
* detect.rb - Add OSX / darwin detection
* TestIntegration#wait_for_server_to_boot - give OSX a delay for boot
* test/helpers/integration.rb - CI fixes
* TestIntegrationCluster#thread_run_pid - try faxt_connect (no read)

Co-authored-by: Patrik Ragnarsson <patrik@starkast.net>
2021-10-31 12:06:58 +01:00
Samuel Williams
cb080346a4
More elaborate exception handling. (#2700)
* More elaborate exception handling. Fixes #2699.

* Add TestIntegrationSingle#test_closed_listener

Co-authored-by: MSP-Greg <Greg.mpls@gmail.com>
2021-09-16 10:54:14 -06:00
MSP-Greg
51ea1b44ea
Update helper.rb TestSkips, add HAS_UNIX_SOCKET to puma.rb [changelog skip] (#2576)
* Update helper.rb TestSkips, add HAS_UNIX_SOCKET to puma.rb

* Tests - skip updates

* test_integration_cluster.rb - fix some test warnings & RuboCop
2021-03-15 08:10:43 -06:00
MSP-Greg
a192434909
Fix CI (#2561)
1. Add racc to Gemfile for JRuby RuboCop
2. test_busy_worker - skip teardown
3. test_integration_single - patch from PR 2560
2021-03-02 08:56:11 -07:00
Chris LaRose
7a2cdf6a7e
Restore sync=true on global stdout/stderr streams (#2557)
* Restore sync=true on STDOUT/STDERR streams

* Move mutation of STDOUT and STDERR streams to `redirect_io`

This isn't technically related to redirecting the STDOUT and STDERR
streams, but moving it here keeps all of the STDOUT/STDERR logic
together. It seems like a more natural place to put it.

* Add a test to ensure that STDOUT is flushed by default
2021-02-22 13:17:03 -07:00
MSP-Greg
c71d149117
Updates for non MRI CI stablity [changelog skip] (#2434)
* Actions non MRI - use JDK11 on macOS, add Big Sur

* Actions MRI - add macOS Big Sur Ruby 2.7

* test/helper.rb - run setup in same Timeout block as test

* TestIntegrationSingle#test_int_refuse - skip on JRuby

Seems to intermittently lockup CI

* TestLauncher#test_puma_stats - fix intermittent non-MRI failure II

* test_out_of_band_server.rb - JRuby - add small sleep after server.run

* test_persistent.rb - JRuby - add small sleep after server.run

* test_puma_server.rb - JRuby - add small sleep after server.run
2020-10-19 09:22:28 -06:00
MSP-Greg
03c3b2f0e1 Improve reliability of non-MRI CI
Jobs still occasionally freeze/time-out in test step.

1. Allows jruby-head to fail (as done previously)

2. Actions - change all Ubuntu JRuby OS's to 20.04 (18.04 uses JDK-8, 20.04 uses JDK-11)

3. Integration tests (cluster, pumactl, single) - only run parallel on MRI Rubies

4. `helper.rb` - `TestSkips` - add `JRUBY_HEAD` constant for use with non-parallel conditionals and skips

5. `test_puma_server.rb` - jruby-head - run non-parallel

6. `test_puma_server_ssl.rb` - `TestPumaServerSSLClient` tests - non-parallel on JRuby, add `Errno::ECONNRESET` to client net/https rescue for TruffleRuby

7. `test_puma_server_ssl.rb` - `TestPumaServerSSL#test_http_rejection` - add `Net::ReadTimeout` to client net/https rescue for TruffleRuby

Update test_puma_server_ssl.rb
2020-10-14 21:37:45 -05:00
MSP-Greg
67c686afa6
Add hot_restart_does_not_drop_connections tests
Co-authored-by: Chris LaRose <cjlarose@gmail.com>
2020-10-12 17:20:06 -05:00
Bradley Price
ae21600c65
Clean up tests (#2387)
* No need in assigning the output of `connect` when it's only used
  in one place.
* Remove inlined config in favor of config file introduced in 39f9c72
2020-09-27 09:33:05 -06:00
sumeka
922c401f7b added BASE to change based on system 2020-08-27 17:37:00 +05:30
sumeka
96e37b6540 skip test for systems which does not have TERM like windows. 2020-08-27 16:09:53 +05:30
sumeka
b6df9905fd [changelog skip] Move integration logging test to main test suite 2020-08-27 16:00:25 +05:30
MSP-Greg
4297d794ff test_integration_single.rb - minor fixes
test_term_not_accepts_new_connections - check correct pid, typo
2020-05-15 12:00:42 -05:00
Nate Berkopec
58104628f3
Fix a bunch of test warnings 2020-05-11 13:21:24 +09:00
Harry Lewis
e5f1655e47
[changelog skip] Move integration logging test to main test suite (#2240)
* Copy test from shell/t1.rb to test/test_integration_t1.rb
2020-04-29 15:06:11 +09:00
Artur Montenegro
5a4e744e8a
Prefer rackup file specified by CLI (#2236)
Co-Authored-By: Cristian Rivera <cristian_rivera@me.com>
Co-authored-by: Artur Montenegro <artur.montenegro@tempest.com.br>
Co-authored-by: Nate Berkopec <nate.berkopec@gmail.com>
2020-04-28 08:15:33 +09:00
Andrew Konchin
80b7148b06
Force curl to output error messages in English locale in tests (#2149) (#2153) 2020-03-07 09:57:17 -06:00
Daniel Colson
39d16fadaf Add pumactl command to print thread backtraces (#2054)
* Add pumactl command to print thread backtraces

Completes 1 of 2 items from #1964

This commit adds an endpoint to the status app to print thread
backtraces, and control cli command to call that endpoint.

I tried this locally by starting a server with:

```sh
bundle exec bin/puma test/rackup/hello.ru \
  --control-url="unix://test.sock" \
  --control-token="token"
```

and then printing the backtraces with:

```sh
bundle exec bin/pumactl thread-backtraces \
  --control-url="unix://test.sock" \
  --control-token="token"
```

* Log threads as JSON in control app

With this commit the status app sends the thread backtraces as an array
of objects with `name` and `backtrace` keys, rather than as a string
matching the SIGINFO output.

While working on this I noticed that we logged the thread TID twice.
This commit simplifies that so we only log the thread TID once, with
both the label (I don't know when the label would get set) and name if
they are available.
2019-11-11 13:08:41 +08:00
MSP-Greg
4c8d4d6921 Update test_integration files per PR #1956 (#1965)
* Update test_integration files per PR #1956

test_integration_cluster.rb

Request handling during server TERM - two tests

`#test_term_closes_listeners_tcp`
`#test_term_closes_listeners_unix`

using `#term_closes_listeners`

Send requests 10 per second.  Send 10, then :TERM server, then send another 30.
No more than 10 should throw Errno::ECONNRESET.

Request handling during phased restart - two tests

`#test_usr1_all_respond_tcp`
`#test_usr1_all_respond_unix`

using `#usr1_all_respond`

Send requests 1 per second.  Send 1, then :USR1 server, then send another 24.
All should be responded to, and at least three workers should be used

Stuck worker tests - two tests

`#test_stuck_external_term_spawn`
Tests whether externally TERM'd 'stuck' workers are proper re-spawned.

`#test_stuck_phased_restart`
Tests whether 'stuck' workers are properly shutdown during phased-restart.

helper files/methods changes

1. helper file changes to allow binding to TCP or UNIX, see kwarg unix:
2. Skip on Windows for signal TERM

* Misc updates, debug output, cleanup

* Add comments

* fix test_int_signal_with_background_thread_in_jruby per review

* TestIntegrationCluster#term_closes_listeners - add interleaved assert

* cluster.rb - remove duplicate Worker#term? method
2019-09-19 19:37:53 +02:00
Nate Berkopec
4cdfb5cd2f
Skip some more invalid JRuby tests 2019-09-19 15:48:16 +02:00
Nate Berkopec
e96e798068
SIGINFO prints thread backtraces (#1320) 2019-09-12 09:59:54 +00:00
Nate Berkopec
7aa77570ed
Remove unnecessary SIGINT trap for Jruby (#1961)
See #1868

The original intent of the trap was to ensure that the socket was removed
properly. It now does, so the trap is no longer necessary.
2019-09-11 16:24:53 +00:00
Nate Berkopec
5bf037d616
Split integration tests into three files (#1959)
* Fix mismatched indent

* Split integration into 3 files
2019-09-11 14:22:29 +00:00