Comments (8)
The async setup func may not be on main thread. Would that be an issue? Will check that later.
from vapor.
@nashysolutions so that normally means something threw an error during start up (try wrapping the configure in a do/catch), causing the app to not spin up properly so that when it comes to teardown it's not in the right state. Are there are errors in the logs?
from vapor.
(If that doesn't provide any pointers is it possible to see the test code? Something weird is going on. Is it always the same test the crashes or any test?)
from vapor.
If I run all of the tests, the failure happens on a specific test.
2023-11-10T04:50:00+0000 info codes.vapor.request : request-id=0301B138-DB3B-453B-9DE6-71F937CC7C32 [Vapor] POST /users
ERROR: Cannot schedule tasks on an EventLoop that has already shut down. This will be upgraded to a forced crash in future SwiftNIO versions.
ERROR: Cannot schedule tasks on an EventLoop that has already shut down. This will be upgraded to a forced crash in future SwiftNIO versions.
BUG in SwiftNIO (please report), unleakable promise leaked.:480: Fatal error: leaking promise created at (file: "BUG in SwiftNIO (please report), unleakable promise leaked.", line: 480)
2023-11-10 04:50:00.698983+0000 xctest[39434:1275754] BUG in SwiftNIO (please report), unleakable promise leaked.:480: Fatal error: leaking promise created at (file: "BUG in SwiftNIO (please report), unleakable promise leaked.", line: 480)
If I run that specific test in isolation, it runs to completion without error.
from vapor.
@nashysolutions which project and which test in that project is it?
from vapor.
I've found the issue.
The aforementioned test had a logical assert condition which was not met by my business logic. A tear down block wasn't triggered afterwards, due to continueAfterFailure
being set to false.
This lead to an EventLoopFuture / EventLoopPromise imbalance that is quite aggressively enforced in debug builds.
/*! - XCTestCase
* @property continueAfterFailure
* Determines whether the test method continues execution after an XCTAssert fails.
*
* By default, this property is YES, meaning the test method will complete regardless of how many
* XCTAssert failures occur. Setting this to NO causes the test method to end execution immediately
* after the first failure occurs, but does not affect remaining test methods in the suite.
*
* If XCTAssert failures in the test method indicate problems with state or determinism, additional
* failures may be not be helpful information. Setting `continueAfterFailure` to NO can reduce the
* noise in the test report for these kinds of tests.
*/
@property BOOL continueAfterFailure;
XCTest runs the teardown methods once after each test method completes: first tearDown(), then tearDownWithError(), then tearDown() async throws. Avoid preparing state for subsequent tests in the teardown methods. XCTest doesn’t guarantee that it will call teardown methods
There's no obvious fix, so perhaps updating the docs to say you guys don't support continueAfterFailure
will suffice?
Or perhaps shutdown should also be called in deinit of the test case?
from vapor.
continueAfterFailure
is badly broken on Linux in any event; it's never been safe to use it.
from vapor.
FYI: adding shutdown in deinit of the test case did not resolve the issue. Will avoid continueAfterFailure
going forward.
from vapor.
Related Issues (20)
- Proposal on Soft Delete. HOT 9
- Install database extensions via Migrations HOT 2
- Websocket Error Propagation & Handling
- Privacy Manifest HOT 3
- Linker Error while using Vapor inside XCode Project HOT 6
- Vapor migrations do not finish running on fly.io HOT 8
- Documentation for cache HOT 5
- Unable to test vapor using .xcodeproj project HOT 8
- Response compression handler not added for HTTP2 requests
- Updating HTTP server configuration on the fly (ie. TLS settings) HOT 3
- Double encoded post requests after recent update (4.89.3 → 4.91.1) HOT 1
- UserAuthnetication middleware is bypassed when auth object is not used HOT 2
- Query decoding broken in 4.90 HOT 3
- vapor and toolbox compile error on arch linux HOT 1
- double slash in URL no longer matches route handlers HOT 3
- URI semantics are broken HOT 1
- commùit
- Double slash in URLs still breaks route matching with variable parts in vapor 4.92.0 HOT 2
- Trying to build on Ubuntu 20 with swift run and getting Building for debugging... error: emit-module command failed due to signal 9 HOT 2
- Unable to shutdown server HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vapor.